Forum Moderators: not2easy
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Top Border</title>
<style type="text/css">
/* This uses a negative margin */
#one {
border: 1px solid #000;
border-top-width: 15px;
background-color: #FFF;
}
#one p.title {
font-size: 11px;
font-weight: bold;
color: #FFF;
margin: -15px 0 2px 0;
padding: 0;
text-align: center;
}
/* This eliminates the top border */
#two {
border: 1px solid #000;
border-top-width: 0;
background-color: #FFF;
}
#two p.title {
font-size: 11px;
line-height: 15px;
font-weight: bold;
color: #FFF;
background-color: #000;
margin: 0;
padding: 0;
text-align: center;
}
</style>
</head>
<body>
<!-- Below uses a negative margin -->
<div id="one">
<p class="title">This is a try</p>
<p>text</p>
<p>text</p>
<p>text</p>
<p>text</p>
<p>text</p>
</div>
<!-- Below eliminates the top border -->
<div id="two">
<p class="title">This is a try</p>
<p>text</p>
<p>text</p>
<p>text</p>
<p>text</p>
<p>text</p>
</div>
</body>
</html>
Marshall
[edit] I only tested this in IE7 so I do not make any promises [/edit]
[edited by: Marshall at 6:40 pm (utc) on Sep. 10, 2007]