Fieldset size question?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bobmct

    Fieldset size question?

    Gentlemen/Ladies;

    I've used the <fieldsetand <legendtags successfully in the past.
    However, now that I'm transitioning over to stricter XHTML and css I'm
    running into a problem that I simply cannot find the answer to.

    Perhaps some of you "seasoned" folks can advise?

    Normally, when I have a form with various <inputelement s within I wrap the
    entire section in a <fieldsetpair and it display a nice fitting single
    line box around my form elements. Looked great!

    However, now that I am coding with css when I either introduce the
    <fieldsettag or migrate some code over, the surrounding box displays from
    edge to edge inside the current DIV box. I've tried various position
    elements, even centering, but it still always wants to fill the entire
    left/right areas.

    Can anyone please shed some light on what I might be missing on this concept
    and/or what may be different in the handling of this TAG when using css?

    Thanks in advance.

    bobmct


  • Jukka K. Korpela

    #2
    Re: Fieldset size question?

    Scripsit bobmct:
    I've used the <fieldsetand <legendtags successfully in the past.
    Fine.
    However, now that I'm transitioning over to stricter XHTML and css I'm
    running into a problem that I simply cannot find the answer to.
    A URL would tell us more than 1,024 words. Anyway, moving to XHTML is
    probably pointless - you are either several years behind (of the fashion
    that never had a point) or several years ahead of time. Besides, (X)HTML is
    either Strict or it is not.
    Normally, when I have a form with various <inputelement s within I
    wrap the entire section in a <fieldsetpair and it display a nice
    fitting single line box around my form elements. Looked great!
    Maybe. A URL would let us decide. Anyway, if you group _all_ elements inside
    a <fieldset>, you might be doing the wrong thing. The <fieldsetelemen t is
    supposed to _group_ fields logically. Typically, a set of radio buttons with
    their labels, acting as one logical unit.

    If you just want a border around an entire form, simply use CSS for that.
    You won't get rounded corners (except via considerable trickery), but
    drawing a border is easy. Making the box just as wide as needed is a bit
    difficult. But please tell us what the markup is and exactly how it should
    appear visually - preferably in c.i.w.a.stylesh eets.
    However, now that I am coding with css when I either introduce the
    <fieldsettag or migrate some code over, the surrounding box
    displays from edge to edge inside the current DIV box.
    Pardon?
    I've tried
    various position elements, even centering, but it still always wants
    to fill the entire left/right areas.
    I guess you have a box sizing issue and actually a CSS problem, not an HTML
    issue.

    However, you _could_ (effectively) draw a border around a form using old
    dirty non-Strict Transitional deprecated anathema boo-boo markup, which
    works pretty well:

    <form ...>
    <table border="1" cellspacing="0" ><tr><td>
    <div>Some stuff here id desired.</div>
    <div><label ...><input ...></div>
    <div>Etc.</div>
    </td></tr></table>
    </form>

    Then you can throw in some CSS to color the border, create nice padding
    etc., e.g.

    <style type="text/css">
    table { border: solid green 1px; }
    td { padding: 0.1em 0.3em; }
    </style>

    --
    Jukka K. Korpela ("Yucca")


    Comment

    Working...