Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XHTML CSS and Height attribute

Status
Not open for further replies.
Unless it is an image tag you're talking about, you're right -- height belongs in the CSS not in the (X)HTML.
 
A while back I remember being told that you could or should no longer use Height in your css if you were using XHTML

Is this right?


You SHOULD use height in your CSS and not as an attribute on an XHTML tag; only exception to that rule is the <img> tag. I personally think that will change eventually though (the <img> tag thingy).

This is correct:
Code:
<div style="height:10px">content</div>

This is incorrect:
Code:
<div height="10">content</div>


[monkey][snake] <.
 
What you might find though is, if you specify height as a percentage then it doesn't behave the way you exepect it to.

Reading between the lines I think that's what you might be getting at.

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top