473,804 Members | 3,397 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

valid usage of the label tag?

Hello,

I have a question about my usage of label as follows.... (sort of a combo
html/css question)

<p>
<label>Field Name</label>Field Data
</p>

Now I know that a lable is generally associated with a form field, but my
question comes from how I style this html. I could use <strong> or <em>
instead of <label> here, but the use of those tag implies to me that I'll be
emphasing the field name and not the data. In come cases, emphasing the
field data might make more sense (or look better) and sometimes emphasing
the data itself might make more sense (or look better). I'd prefer my html
not imply that the field name be emphasied and that I make that decision via
css, by styling the label or the text seperately. So to me, label is a more
generic tag that makes stll makes sense in it's context and doesn't imply
that the field name is bold or emphasized etc.

So, is my usage of label here not recommended? Or is it fine?

Thanks,
Andrew
Nov 23 '05 #1
5 1988
andrew wrote:
Now I know that a lable is generally associated with a form field
That is its *only* purpose.
but my question comes from how I style this html. I could use <strong> or
<em> instead of <label> here, but the use of those tag implies to me that
I'll be emphasing the field name and not the data.
Sounds like this may be a job for <th>.
So to me, label is a more generic tag
The advantage of everybody using a standard markup language, where the
meaning of each element is agreed, is that its (relatively) easy to write
software that understands everybody's documents. "To me" doesn't really
have a place in that philosophy.
So, is my usage of label here not recommended?


Correct

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Nov 23 '05 #2
Ok, agreed. I guess I'll go with <em> then as this is definitely not
tabular data, and therefore <th> is out of the question.

Thanks for the response.

"David Dorward" <do*****@yahoo. com> wrote in message
news:dl******** ***********@new s.demon.co.uk.. .
andrew wrote:
Now I know that a lable is generally associated with a form field


That is its *only* purpose.
but my question comes from how I style this html. I could use <strong>
or
<em> instead of <label> here, but the use of those tag implies to me that
I'll be emphasing the field name and not the data.


Sounds like this may be a job for <th>.
So to me, label is a more generic tag


The advantage of everybody using a standard markup language, where the
meaning of each element is agreed, is that its (relatively) easy to write
software that understands everybody's documents. "To me" doesn't really
have a place in that philosophy.
So, is my usage of label here not recommended?


Correct

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is

Nov 23 '05 #3
andrew wrote:
Ok, agreed. I guess I'll go with <em> then as this is definitely not
tabular data, and therefore <th> is out of the question.


Wait! If it's a label for a form control, you should stick with the
label element. You can style it with CSS, if you want to.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Nov 23 '05 #4
andrew napisa³(a):
Ok, agreed. I guess I'll go with <em> then as this is definitely not
tabular data, and therefore <th> is out of the question.

Thanks for the response.


Why can't you use <dt><dd>?

--
Janusz 'Kali' Kaliszczak
Nov 23 '05 #5
Johannes Koch wrote:
Wait! If it's a label for a form control


It isn't - that was the point.

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Nov 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
8212
by: lawrence | last post by:
I have a string which I want to send to eval(). How can I test it ahead of time to make sure it is valid code? I don't want to send it to eval and get parse errors. I want to do something like this: $valid = checkPHP($string); if ($valid) { eval($string); } else { $resultsObject->addToErrorResults("We wanted to send our template to eval(), but the PHP it contained was invalid.");
0
961
by: kalyan.abbaraju | last post by:
Hi, I have to write a code in which based on a user selection in a combo box, pages in NoteBook should be automatically added or deleted. So, I have the following class. class myActionsDialog: def __init__ (self, top): self.ActionsWidget = dict()
4
16987
by: Todd Perkins | last post by:
Hello all, surprisingly enough, this is my first newsgroup post, I usually rely on google. So I hope I have enough info contained. Thank you in advance for any help! Problem: I am getting this error when I try to pull up my edit page to display the current database information in the form, and then edit it on click:
6
6426
by: Biva | last post by:
Hello All, Please help. I get the following error from my webpage: System.InvalidCastException: Specified cast is not valid. at Time.MaintAtRiskProjects.UpdateProject(String Project, String AtRiskCode, String Comment) Code for UpdateProject(String Project, String AtRiskCode, String Comment) is:
5
6740
by: Grant Mills | last post by:
Is there anyway to reduce the amount of memory a VB.net program allocates? Just a simple windows form, with one button and a label, and all the button does is change the text in the label (it's even hardcoded) and the EXE is using 15000+k of memory according to the task manager... I mean I realize that VB is going to be more bloated than a C++ app. But is
10
16434
by: dba123 | last post by:
Why am I getting this error for Budget? Error: An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in user code Additional information: String was not recognized as a valid Boolean. Public Sub UpdateCustomer_DashboardGraphs(ByVal sender As Object, ByVal e As System.EventArgs)
4
17893
by: ckirchho | last post by:
Hallo, In a form I have several text or checkbox inputs with their appropriate labels. I'd like to keep label and input together, so I connect them with a &nbsp;, like: <input type="checkbox" name="h" value="1" id="chk"/>&nbsp;<label for="chk">Schreibweisentolerant</label> Apparently this doesn't work in Firefox 2. It works in IExplorer and Opera. As well I tried:
3
8018
by: Ken Cox [Microsoft MVP] | last post by:
I've been going around and around on this one. I can't believe that it is "by design" as Microsoft says. Here's the situation: In *declarative* syntax, I'm trying to create a default datetime value for a SqlDataSource parameter. (I know how to insert this parameter in code. I want to use declarative markup.) Here's the declarative markup with ???????? indicating where I'm stumped.
2
352
by: Cirene | last post by:
I'm setting a databound label's backcolor and forecolor like this... <asp:Label ID="lblSampleColorScheme" runat="server" BackColor='<%# System.Drawing.Color.FromName(Eval("AttachmentEntityBackColor")) %>' Font-Bold="True" ForeColor='<%# System.Drawing.Color.FromName(Eval("AttachmentEntityForeColor")) %>'
0
9575
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10320
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10308
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9134
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7609
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6846
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5513
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3806
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2981
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.