我正在创建一个样本网站,其中有三个水平分区。 我希望最左边的分区宽度为25%,中间的分区宽度为50%,右边的分区宽度为25%,以便分区水平填满100%的空间。
<html>
<title>
网站标题
</title>
<div id="the whole thing" style="height:100%; width:100%" >
<div id="leftThing" style="position: relative; width:25%; background-color:blue;">
左侧菜单
</div>
<div id="content" style="position: relative; width:50%; background-color:green;">
随机内容
</div>
<div id="rightThing" style="position: relative; width:25%; background-color:yellow;">
右侧菜单
</div>
</div>
</html>
https://i.stack.imgur.com/NZDJe.jpg
当我执行这段代码时,divs会重叠显示。我希望它们并排显示!
我该怎么做?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号