Jump to content

margin-top


sircharlo

Recommended Posts

according to this test I ran

<html><head>	<title></title>	<style>			div.line		{			padding:5px;			background: #424242;		}				span.para		{			display: block;			margin-top:16px;			margin-bottom:16px;		}		</style>	<!--[if IE]>	<style>			span.para		{			display: block;			margin-top:19px;			margin-bottom:19px;		}		</style>	<![endif]--></head><body>	<table cellpadding="0" cellspacing="0">		<tr>			<td>				<div class="line"></div>				<p>paragraph</p>				<div class="line"></div>			</td>			<td>				<div class="line"></div>				<span class="para">span</span>				<div class="line"></div>			</td>		</tr>	</table></body></html>

<p> in standards compliant browsers have a top and bottom margin of 16px and IE6 and 7 have a top and bottom margin of 19px. The code above shows how to make a span tag behave like a paragraph tag. I tested this in IE6, IE7, Firefox 2.0.0.4, and Opera 9.2

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...