EDIT: I'm realizing now the title of this thread is no longer appropriate as I decided to change my question while typing it. A more appropriate title is "[HTML 4.01 T] Semantics for name/value pairs" Hello all, I would like to provide my code with correct (or near correct) semantics for the following example snippet: <p>Location: Madeira, Funchal</p> <p>Business: Sale</p> <p>Reference: VA32</p> <p>Price: € 450,000.00</p> <p>Total area: 1,000 m<sup>2</sup></p> Code (markup): Its basically a non list of name/value pairs in which the values will later be supplied by a script. What would you suggest? As an extra question, would XHTML provide me with better semantics? I'm still wanting to study this specification, but can't at this point where it's more important I stick to what I'm more familiar with.
You're going to want to use a definition list here. It looks like this: <dl> <dt>Location:</dt> <dd>Madeira, Funchal</dd> <dt>Business:</dt> <dd>Sale</dd> <dt>Reference:</dt> <dd>VA32</dd> <dt>Price:</dt> <dd>€ 450,000.00</dd> <dt>Total area:</dt> <dd>Total area: 1,000 m<sup>2</sup></dd> </dl> Code (markup):
Thanks Dan, I was going for a <em> / <var> combination. DL/DT/DD did cross my mind at some time, but I couldn't quiet place it within the semantics of a value/pair combination until you suggested it and forced me back into the specification. What I found was that I missed this paragraph (emphasising is mine): Basically I was being too strict. It later proceeds to show an example where a DL is being used for dialog lines. Thank you for the reply.
No problem. Structurally speaking, EM is used to give a selection of text "emphasis" while var is used to identify a variable from a computer program. For example... <p> The variable <var>$name</var> stores the <em>name of the person</em> filling out the email contact form. </p> Code (markup):
We also chose definition lists to show output of a form. The dt's were taken from the labels of the forms, while the dd's were variables coming from the customer's input. <p>Location: Madeira, Funchal</p> Even if one side is emphasised and the other is a variable, is this still not a term (location) and a definition (here is name of the location)?
Lists should never be used to contain form fields, since form fields are not content, they're containers. For more information, go to http://green-beast.com/blog/?p=259
Nay, it's a form OUTPUT. The form has been filled out, and submit was hit, and the information is presented back to the user so they can check that everything was filled in correctly. http://stommepoes.nl/Pizzaatje/invoeren2.html remove the "2" to see the form. This is what I mean.