By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,874 Members | 1,027 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,874 IT Pros & Developers. It's quick & easy.

legend in fieldset, position horizontally as centrified

P: n/a
Can the legend element in fieldset be placed automatically by Mozilla
horizontally in the middle of fieldset?

Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Marek Mänd wrote:
Can the legend element in fieldset be placed automatically by Mozilla
horizontally in the middle of fieldset?


Maybe. What have you tried? I'd start with text-align: center on
fieldset. You might also try positioning:

fieldset {position: relative;}
legend
{position: absolute;
left: 50%;
width: 10em;
margin-left: -5em
}

--
Brian (remove "invalid" to email me)
http://www.tsmchughs.com/
Jul 20 '05 #2

P: n/a
Brian wrote:
Marek Mänd wrote:
Can the legend element in fieldset be placed automatically by Mozilla
horizontally in the middle of fieldset? Maybe. What have you tried?


In Opera7.54 setting
margin-right:auto makes the legend to be on the left
margin-left:auto makes the legend to be on the right

margin-left:auto margin-right:auto makes the legend to be in the center.

Opera doesnt honour explicit pixel values like
margin-left:30px

Mozilla 1.72 aswell as IE6 do honour explicit pixel values for
margin-left, yet they doent understand the margin auto stuff.
I'd start with text-align: center on fieldset. You might also try positioning:

fieldset {position: relative;}
legend
{position: absolute;
left: 50%;
width: 10em;
margin-left: -5em
}


Your proposed along with mine code (601 bytes)
http://www.hot.ee/idaliiga/testcases...ify_legend.htm
shows that your proposed solution will not likely work in current Mozillas.
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.