div怎么分左右两半?
摘要:在内容排版上以前是在左上角放置广告后,内容跟随到广告下面,这次希望左右分开,不要跟随到广告下面,因为数据比较短,跟随到下面不留意发现,于是用...
在内容排版上以前是在左上角放置广告后,内容跟随到广告下面,这次希望左右分开,不要跟随到广告下面,因为数据比较短,跟随到下面不留意发现,于是用到了div来控制左右两边分离,给需要的朋友参考下:
代码非常简单:
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>exhibitor114</title>
<style type="text/css">
<!--
#exhibitor114{ margin:0 auto;width:auto;height:100%}
#exhibitorleft{ float:left; width:44%; height:100%; background:#eeeeee}
#exhibitorright{ float:left; width:56%;height:100%;}
-->
</style>
</head>
<body>
<div id="exhibitor114" style="float:inherit">
<div id="exhibitorleft">左侧</div>
<div id="exhibitorright">右侧</div>
</div>
</body>
</html>
【div怎么分左右两半?】相关文章:
★ firefox不显示border通过清除float便可解决
上一篇:
如何在两个div之间进行切换