
November 11th, 2012, 10:30 AM
|
 |
~ bald headed old fart ~
|
|
Join Date: May 2005
Location: chertsey, a small town s.w. of london, england
|
|
Hi there rehowes,
and a warm welcome to these forums.
The easiest way to explain this to you, is, I hope, by letting you experiment with this code....
Code:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<style type="text/css">
body {
background-color:#f00;
margin:0;
font-size:80px; /* the gap at the bottom of the img element varies according to the font-size */
}
div {
background-color:#00f;
/*overflow:hidden;*/ /* use this when the img element has foat:left */
}
img {
/* the gap at the bottom occurs because it is an inline element,
un-comment each in turn to see the result
*/
/*display:block;*/
/*float:left;*/ /* the containing div requires overflow:hidden if this option is used */
/*vertical-align:bottom;*/
}
</style>
</head>
<body>
<div>
<img src="http://www.coothead.co.uk/images/anim.gif" alt="">
</div>
</body>
</html>
By each in turn I mean use "display:block" or "float:left with overflow:hidden in the div" or "vertical-align:bottom".
coothead
__________________
Last edited by coothead : November 11th, 2012 at 10:35 AM.
|