[thelist] CSS: suggestions for handling forms and other random styles

Chris W. Parker cparker at swatgear.com
Mon Jul 22 14:15:03 CDT 2002


hi.

in using css i consistently come across the same situation. the random
one time (maybe 2 or 3) use of a piece of text.

for example... in a form i'm working on right now i think that <h5>
works well to define the different sections of the form. i.e. Shipping
Information

at the same time though, i might have some sort of instruction that goes
along with Shipping Information like "(If different from Billing
Information)"

this leads me to mark it up like this...

<h5>Shipping Information</h5>
<p>(If different from Billing Information)</p>

the problem is that of course they are block elements (is this correct?)
and thus <p> makes a new paragraph.

option 1: define in my stylesheet no padding like so...

h1, h2, h3, h4, h5 {
	padding: 0px 0px 0px 0px;
	}

option 2: add a style to the h5 tag like so...

<h5 style="padding: 0px 0px 0px 0px">

however i don't like using the style attribute since it defeats the
whole purpose of a stylesheet. (considering if you want to change the
style of the headers you have to change each one.

option 3: define a class for this particular occurence like so...

.noPadding {
	padding: 0px 0px 0px 0px;
	}

option 4: define a class that i would use in a span.

.formHeading {
	font size;
	font weight;
	font color;
	padding;
	...etc...
	}



so, how do you all think i should handle these odds and ends?


thanks,
chris.



More information about the thelist mailing list