dave
dave

Reputation: 15459

How come when floating a div inside a fieldset to the left, it actually floats right?

here is the html:

<fieldset>
   <div>
   </div>
</fieldset>

here is the css:

fieldset
{
  float:  left;
  width:  200px;
}
   fieldset > div
   {
      float:  left;
      width:  100px;
   }

and for some reason the div appears to be floating right, why is that?

Upvotes: 1

Views: 2567

Answers (1)

Saurabh Gokhale
Saurabh Gokhale

Reputation: 46395

It actually works fine with me. It floats to the left, instead to the right.
Here's something that I tried,
Index.html

<html>
<head>
<title></title>
<LINK REL=StyleSheet HREF="index1.css" TYPE="text/css" MEDIA=screen>
</head>
<body>
<fieldset>
<div> </div>
</fieldset>
</body>
</html>  

and index1.css

fieldset
{
  float:  left;
  width:  200px;
}
fieldset > div
{
     float:  left;
     width:  100px;
  } 

and the fieldset is on the left.

Have a look here : Floating div to left inside the fieldset

Upvotes: 1

Related Questions