下面這段代碼是個常見的問題,解決的辦法也有多個,最近發現一種放,放上來和大家討論一下:
問題代碼:
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<style type="text/css" media="screen">
<!--
#content { overflow: hidden; zoom: 1; }
#left { float: left; width: 200px; }
#right { background: #ffc8d0; }
-->
</style>
</head>
<body>
<div id="content">
<div id="left">
left - VeVb.com
</div>
<div id="right">
right - VeVb.com
</div>
</div>
</body>
</html>
解決后css:
#content { overflow: hidden; zoom: 1; }
#left { float: left; width: 200px; }
#right { background: #ffc8d0;overflow: hidden; zoom: 1; }
查看運行效果:
[ctrl+a 全部選擇 提示:你可先修改部分代碼,再按運行]
新聞熱點
疑難解答