legend in fieldset, position horizontally as centrified

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marek Mänd

    legend in fieldset, position horizontally as centrified

    Can the legend element in fieldset be placed automatically by Mozilla
    horizontally in the middle of fieldset?

  • Brian

    #2
    Re: legend in fieldset, position horizontally as centrified

    Marek Mänd wrote:[color=blue]
    > Can the legend element in fieldset be placed automatically by Mozilla
    > horizontally in the middle of fieldset?[/color]

    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)

    Comment

    • Marek Mänd

      #3
      Re: legend in fieldset, position horizontally as centrified

      Brian wrote:[color=blue]
      > Marek Mänd wrote:[color=green]
      >> Can the legend element in fieldset be placed automatically by Mozilla
      >> horizontally in the middle of fieldset?[/color]
      > Maybe. What have you tried?[/color]

      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[color=blue]
      > fieldset. You might also try positioning:
      >
      > fieldset {position: relative;}
      > legend
      > {position: absolute;
      > left: 50%;
      > width: 10em;
      > margin-left: -5em
      > }[/color]

      Your proposed along with mine code (601 bytes)

      shows that your proposed solution will not likely work in current Mozillas.

      Comment

      Working...