[thelist] CSS - label tag

thelist at cjmarsh.com thelist at cjmarsh.com
Sun Feb 13 12:40:50 CST 2005


All

I'm building a site that I want to validate according to the W3C CSS
validator. I have a form with a number of text fields, and in order to
maintain semantic integrity I have used the following markup:

<p>
<label>Field 1</label><input type='text' />
<label>Field 2</label><input type='text' />
<label>Field 3</label><input type='text' />
</p>

I have constrained the width of the "p" tag, and so I want to specify
the width of the label tags so that everything flows without any extra
presentational markup. Everything is fine when I specify "display:
inline-block" for the label tag, but this does not validate. Any other
"display" value results in the width specified for the label tag being
ignored.

Can anyone suggest a solution that will validate?

Many thanks!

Regards

Chris Marsh



More information about the thelist mailing list