[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3456
  • Last Modified:

Width of a fieldset

By default, a fieldset will use all the horizontal space available, just like table do with a "width: 100%". How can I make sure that my fieldset only uses the space "it needs", just like tables do by default?

E.g. for an example of fieldset that is wider than it needs to be:
http://photos10.flickr.com/13328349_e56bcc93c3_o.png

Alex
0
avernet
Asked:
avernet
1 Solution
 
BatalfCommented:
There could be better solutions, but if you set a very small size of the fieldset, it will expand automatically.

example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <title>Test</title>
    <style type="text/css">
    fieldset{
    width:10px;
    }
    </style>
</head>
<body>
<fieldset>
    <legend>THis is my test</legend>
    <h1>this is the content of this fieldset</h1>
</fieldset>
</body>
</html>
0
 
GrandSchtroumpfCommented:
> if you set a very small size of the fieldset, it will expand automatically.
Not in firefox.  Try your code with a smaller legend and you'll see.

I guess the only way is to include the textfield in a table...  :(
0
 
06vsantiCommented:
The best thing to go would be in pixels instead of percent so <IMG SRC="imagename.ext" width="100" height="100"> That would make a 100 x 100 pixel image.
-Sipo
0
 
Computer101Commented:
PAQed with points refunded (100)

Computer101
EE Admin
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now