注意:在我发布我的问题之前,我已经搜索了这个网站以获得答案,但我找不到任何可以让我设置相等的百分比值边距的解决方案。
以下代码未缩放到完整的 25%:
请参阅下面的示例 HTML 代码:
<style>
#Wrapper {
margin:0 auto;
width:70%;
}
#MainLogo{
width:100%;
height:100px;
border:1px solid #000;
}
#LeftSide{
width:25%;
height: 600px;
background-color:#90F;
margin-top:5px;
float:left;
}
#FloatLeft {
float:left;
}
#One{
width:25%;
height:300px;
background-color:#000;
margin-top:5px;
float:left;
}
#Two{
width:25%;
height:300px;
background-color:#F00;
margin-top:5px;
float:left;
}
#Three{
width:25%;
height:295px;
background-color:#F00;
margin-top:5px;
float:left;
clear:both;
}
#Four{
width:25%;
height:295px;
background-color:#000;
margin-top:5px;
float:left;
}
#RightSide{
width:25%;
height: 600px;
background-color:#00F;
margin-top:5px;
float:right;
margin-bottom:5px;
}
#MainFooter{
width:100%;
height:100px;
border:1px solid #000;
clear:both;
}
</style>
<body>
<div id="Wrapper">
<header id="MainLogo">
Logo Goes here!!
</header>
<aside id="LeftSide">
Left side goes here
</aside>
<div id="FloatLeft">
<aside id="One">
One Goes Here!!
</aside>
<aside id="Two">
Two aside goes here!!
</aside>
<aside id="Three">
Three aside goes here!!
</aside>
<aside id="Four">
Four aside goes here!!
</aside>
</div>
<aside id="RightSide">
Right side goes here
</aside>
<footer id="MainFooter">
Main Footer Goes here!!
</footer>
</div>