Elements being siblings just means that they have the same parent. E.g., the following two Ps are siblings:
HTML Code:
<body>
<p>Foo.</p>
<p>Bar.</p>
</body>
Styling of fieldset/legend is somewhat restricted in current browsers. If the legend doesn't do what you want then try placing a span inside it and style that instead. Similarly place a div outside the fieldset if that doesn't play ball. If you want to move the legend around then you can use absolute positioning:
HTML Code:
<div class="fieldset-div">
<fieldset>
<legend><span>Gender</span></legend>
<label><input type="radio" name="sex" value="Male"> Male</label>
<label><input type="radio" name="sex" value="Female"> Female</label>
</fieldset>
</div>
Code:
.fieldset-div { position:relative; /* establish a containing block for absolutely positioned descendants */ }
fieldset { border-style:none; margin:0; padding:0 0 0 3.5em; }
legend span { position:absolute; left:0; }
Bookmarks