468,170 Members | 2,046 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,170 developers. It's quick & easy.

Cutting fieldsets down to size


Fieldsets, as introduced with, I think, HTML 4, tend to span
the entire width of the window.
As most (all?) "Block", or so, elements do...

What I would like, however, is a solution do cut them down,
so they surround their content, obviously, but not more than needed.

Specifying a width like "50%" seems to apply to the container
width too, which would again be the window,
and not very flexible since it ignores the content entirely...

One could, of course, put them inside a table's "td",
but that's not a solution :)
Just in case you need an example "fieldset"-page:
http://webplaza.pt.lu/dostert/fieldset.htm
Hope to have been clear :)
Yours
P

--
The intellect, as a means for the preservation of the individual,
unfolds its chief powers in simulation.
- Friedrich Nietzsche (1844-1900) -

Jul 20 '05 #1
2 2891
PatD wrote:
Fieldsets, as introduced with, I think, HTML 4, tend to span
the entire width of the window.
AFAIK, yes. (I wouldn't use the word "span"; span is the name of a
tag that is not block-level, and just confuses things).
As most (all?) "Block", or so, elements do...
By default, yes.
What I would like, however, is a solution do cut them down,
so they surround their content, obviously, but not more than needed.
Use the width property.
Specifying a width like "50%" seems to apply to the container
width too, which would again be the window,
and not very flexible since it ignores the content entirely...
No no, specify it on the element. And don't use percent. Since it
will contain text labels, use em (or ex) units. Perhaps specify a
max-width if this stylesheet will be used with pda's or the like.

fieldset {
width: 8em ;
max-width: 95% ;
}
One could, of course, put them inside a table's "td",
but that's not a solution :)


Not for presentation, no. You could use display: table-cell, but that
doesn't work in IE, and width does.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #2
On Wed, 10 Sep 2003 22:30:09 GMT, Brian
<us*****@mangymutt.com.invalid-remove-this-part> wrote:
PatD wrote:
What I would like, however, is a solution do cut them down,
so they surround their content, obviously, but not more than needed.


Use the width property.
Specifying a width like "50%" seems to apply to the container
width too, which would again be the window,
and not very flexible since it ignores the content entirely...


No no, specify it on the element. And don't use percent. Since it
will contain text labels, use em (or ex) units. Perhaps specify a
max-width if this stylesheet will be used with pda's or the like.

fieldset {
width: 8em ;
max-width: 95% ;
}


Indeed, works nicely. (Once you figure out the size in em of the content :).
It behaves well too on too small a window.

Thanks!
Yours
P

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Liberal | last post: by
3 posts views Thread by Trent | last post: by
4 posts views Thread by andrew | last post: by
4 posts views Thread by Matt Haggard | last post: by
realin
1 post views Thread by realin | last post: by
5 posts views Thread by Roger | last post: by
jlm699
2 posts views Thread by jlm699 | last post: by
reply views Thread by gcreed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.