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?
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
精彩评论