Forum Moderators: open
HTML:
<div class="box">
<span class="boxtitle">Title goes here</span>
</div>
CSS:
div.box {
margin-top: 0.7em;
border: 2px groove;
}
span.boxtitle {
position: relative;
top: -0.7em;
padding: 0 3px;
margin: 0 3px;
color: inherit;
background: #fff;
}
As for the space beneath forms, you can easily get rid of that by specifying..
form {
margin: 0;
padding: 0;
}
You use it like this..
<form action="..." method="post">
<p>
<fieldset>
<legend>Personal Information</legend>
<label>Last name:<input name="lastname" type="text" tabindex="1"></label>
<label>First name:<input name="firstname" type="text" tabindex="2"></label>
</fieldset>
</p>
</form>
On IE6 it generates a nice rounded box with the legend text appearing in the top edge as you describe.