为什么要添加clear:both?
为什么对.wrap声明了clear:both后,文字才居中显示?clear:both有什么作用?
/*下面是代码任务区*/
.wrap{
clear:both; /*如果去掉这段代码,不能达到居中显示的效果*/
float:left;
position:relative;
left:50%
}
.wrap-center{
background:#ccc;
position:relative;
left:-50%;
}