...

View Full Version : <fieldset> & <legend> & CSS



MrJL
11-16-2002, 03:21 AM
Ok, I recently stumbled across this little bit of coding:


<fieldset>
<legend>
This Is A Legend
</legend>
This is 'body' stuff.
</fieldset>

This is valid stuff, so no worries there. :cool: See This Tut (http://www.htmlcodetutorial.com/forms/_FIELDSET.html).

I'm currently using CSS to format my block of code...Here's the appropriate snip from my style sheet:


legend{
font-weight:bold;
padding:3px;
margin-bottom:5px;
background:#FFF77B;
border:2px solid #DE4A00;
}

Now here's where I'm running into my problem...Multiple tutorials state that you move the 'title' (Legend) from left to center to right, depending on <legend align="left/center/right">

However, I am at a loss on how to include this in the style sheet? I've tried a multitude of things, including...

align:center
text-align:center
position:center
legend-align:center

And none of it works. I'd like to include this in the style sheet to avoid having to change the align=xxxxxx on several pages if I want to impliment a change. Any ideas? Any links? I've browsed a ton of pages this evening trying to find a solution, and nothing has worked. Any help would be greatly appreciated. Thanks! :)

Jer!

MCookie
11-16-2002, 09:28 AM
I've used fieldsets and legends on a few pages and noticed the following (on Macintosh);
In IE text-align:left/center/right makes the legend go left, center or right;
In Mozilla the legend sits always left, no matter what I specified;
In Opera, the legend is not only always at the right, no matter where I told it to go, it's IN the fieldset and not at the border like in IE and Moz.
I don't worry about it anymore..

COBOLdinosaur
11-16-2002, 07:34 PM
center is IE only. Left and Right in Netscrap 6+. Top and bottom not supported by IE. You need to use align in the tag itself to get it to work properly. Alignment is depreciated in the HTML standard 4.0 and I think not support at all in the XHTML1 standard.

MrJL
11-16-2002, 08:19 PM
Ok, thanks guys! :)
Was afraid I'd have to do it in the tag, but I think it's still managable. :)

Thanks, again! :)

Jer!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum