关于浮动元素float使其父元素高度塌陷的原因及解决方法https://blog.csdn.net/chris_z_0622/article/details/65442975
错在哪里?
<!--在此定义一个类选择器myBox,根据要求设置相关CSS属性-->
<stlye type="text/css">
.mybox{
border:1px solid red;
height:100px;
width:200px;
margin-top:10px;
padding-left:15px;
}
</stlye>
</head>
<body>
<div class="mybox">Hello World!</div>
<!--在此添加一个div标签,并设置其class属性为myBox-->
<!--在此定义一个类选择器myBox,根据要求设置相关CSS属性-->
<stlye type="text/css">
.mybox{
border:1px solid red;
height:100px;
width:200px;
margin-top:10px;
padding-left:15px;
}
</stlye>
</head>
<body>
<div class="mybox">Hello World!</div>
<!--在此添加一个div标签,并设置其class属性为myBox-->
body{
width:100%;
}
a{
width:740px;
height:50px;
background-color:#c9f;
}
b{
width:210px;
height:50px;
background-color:#fcf;
float:left;
}
</style>
</head>
<body>
<div id="a">1</div>
<div id="b">2</div>
width:100%;
}
a{
width:740px;
height:50px;
background-color:#c9f;
}
b{
width:210px;
height:50px;
background-color:#fcf;
float:left;
}
</style>
</head>
<body>
<div id="a">1</div>
<div id="b">2</div>