|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
layers - extra padding!
hey there, check out
http://www.hysteriaweb.net/temp/annoying.html what you have here is a div which has a green border and a red background. it has a white img on it as the content. The image is the same size as the width/height of the div. why does this red line show where there is a space between the bottom of the img and the bottom of the div? when I make the img bigger it resizes the div layer and leaves the red line there. View source, I have set margins and padding to 0px on all sides. why is it still there???? how can I get rid of it? thanks |
|
#2
|
|||
|
|||
|
RE: layers - extra padding!
that is by w3c standard.
try this code: Code:
<html> <body> <div id="content-front" name="content-front" style=" position: absolute; left: 82; top: 99; width: 550; height: 300; background-color: red; border-width: thin; border-style: solid; border-color: #00ff00; padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; "> <font size="+3" color=white><img src="http://www.hysteriaweb.net/phpgraphics/crop2.img.php?width=550&height=300">p</font> </div> </body> </html> i added font size and color so you can see it better, but it is the same without them. it is because by default, bottom line of the image is placed at the "base line" of the text. base line is the line that goes here when text is underlined. but text can go below the base line as in letters pqg etc.. that space is there because browser (by w3c recomendation) leaves some space for the text that can go there. i think that this can be changed, but i don't know how. for more info on similar topics, look: http://devedge.netscape.com/viewsource/2002/almost-standards/ http://devedge.netscape.com/viewsource/2002/img-table/ hope that helps... |
|
#3
|
|||
|
|||
|
RE: layers - extra padding!
In your <img> tag you can add either:
style="vertical-align: text-bottom;" (or in global css file as a class) or align="absbottom" |
|
#4
|
|||
|
|||
|
RE: layers - extra padding!
thanks for the info
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > layers - extra padding! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|