<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<title>height loose</title>
</head>
<body>
<div style="margin:auto;width:350px;border:5px solid #CCC;">
<img style="float:left;margin-top:0.5em" src="Design.jpg" />
<span style="float:right;margin-top:1em; margin-right:0.5em">
<b>Development</b>
</span>
</div>
</body>
</html>
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2sAYlSsDb9hvdJYu_7Kh6JjLFqTbQvpghSB-6iCqFo9932BP4L8LPRyTw7wkVYk2DbqTcY9Okxn_uu-teJEfI0xzpKgfB5iBLrmj9J23AA2TfFciLtRl6-GTbGOTeStjQt0g7jNsY_PpO/s400/2009-09-20-DesignDevJustTopBorder.jpg)
To solve the problem, it's necessary to explicitly set the height of block and it's better to use em for height size unit cuz of covering different font size of contents:
<style type="text/css">
#hdr {
height: 4em;
}
</style>
<div id="hdr" style="margin:auto;width:350px;border:5px solid #CCC;">
...
</div>
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqoGKx0oyaoQ4xqw6q_I_fEwJMd85krR9e0Uq3btoWPiioYUTr3uvP9mfwI8sq0F4tPnOV_hnViq7PjJzqA4xmhEGHFa9hyQygZM_L-Aiwt0Z2vwMSYocIJPjgbZ5jpedp4Ja37hUFETzn/s400/2009-09-20-DesignDevWithBorder.jpg)
IE doesn't show such a behavior, it's yet another place that coder should consider cross browser development techniques.
No comments:
Post a Comment