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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xhtml strict img problems 1

Status
Not open for further replies.

soniclnd

Technical User
Jan 6, 2005
51
US
hello i know html and want to change my work into xhtml. however when i put an image it always put a padding to the bottom of it (even if specifically assign no border, margin, or padding)
can anybody help me?
 
That is a strange error message. How can it be both outside and inside the comment? Try adding spaces or line breaks to your comment:

<!--
startminitable
-->

xhtml is case sensitive. It could be that your styles aren't applying because your xhtml tags are properly lowercase, but you define your style declarations in uppercase.

See if changing your style declarations to lowercase fixes the problem.



Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
Add "display: block" to the style for your img tags. The images are displaying as inline, causing the td's line-height to be over 15px.

 
works great.... thanx a lot philote
so inline elements automatically have padding to the top and bottom? and block elements dont?
 
That link says the height doesn't apply to inline elements. Instead the height is somehow based on the font size. I bet most browsers make the line-height a bit bigger than the font size so that text doesn't touch other text above or below.

I believe what happened in your case is the browser saw the inline image and set the line-height of the <td> to a little bigger than the image. So alternatively you could have forced the line-height of the <td> to be 15px to fix your problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top