Posted by BootNic on 04/06/06 06:57
> "William Krick" <wkrick@gmail.com> wrote:
> news:1144266048.089162.12430@e56g2000cwe.googlegroups.com....
>
> When I use the <form> tag and give it a background color, by
> default, the form's width is 100%.
>
> I would like it to behave like a table and have it constrict to fit
> the content inside of it.
>
> Is this possible with CSS?
>
> Or do I have to resort to something ugly like putting a table around
> the form?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content=
"text/html; charset=windows-1252">
<style type="text/css">
form{
display:table;
color:#0000FF;
background-color:#E6E6FA;
border:#800080 0.1em solid;
}
input{
display:block;
margin:0.3em;
}
</style>
<!--[if IE]>
<style type="text/css">
form{
width:1px;
overflow:visible;
}
</style>
<![endif]-->
<title></title>
</head>
<body>
<form action="#">
<div>
<input><input type="submit">
</div>
</form>
</body>
</html>
--
BootNic Wednesday, April 05, 2006 9:32 PM
Genius is eternal patience.
*Michelangelo*
[Back to original message]
|