gpt4 book ai didi

html - "Clear:Both;"不清除 float 的 div

转载 作者:行者123 更新时间:2023-11-28 10:56:49 25 4
gpt4 key购买 nike

我有一个问题,我的 div .gridContainer(黑色背景)没有随着主体 div 扩展,而是用于页脚。据我所知,它应该只是一个使用 clear:both; 的简单修复。在空 div 上的 css3 中。

...但这似乎不起作用!我玩了一把,但似乎无法弄清楚这个问题是否有人可以告诉我这里发生了什么? (使用 Chrome )。

Website issue

<body>

<div class="gridContainer clearfix">
<div id="navigation">
<nav>
<ul>
<li><a href="#">HOME</a></li>
<li><a href="#">ABOUT</a></li>
<li><a href="#">PORTFOLIO</a></li>
<li><a href="#">BLOG</a></li>
<li><a href="#">VIDEOS</a></li>
<li><a href="#">PHOTOGRAPHY</a></li>
<li><a href="#">CONTACT</a></li>
</ul>
</nav>
</div>
<div id="body">
<div id="CALogo"><img src="Images/CALogoLarge.png" alt="CreativeAbyss"></div>
</div>
<div id="footer">
<div id="FooterLeft">©2014 Creative Abyss. All Rights Reserved.</div>
<div id="FooterRight">Social Icons Here </div>
<div id="test"></div>
</div>
<div id="test"></div>
</div>
</body>



@media only screen and (min-width: 769px) {
.gridContainer {
width: 88.2%;
max-width: 1232px;
padding-left: 0.9%;
padding-right: 0.9%;
margin: auto;
height: 100%;
}

#navigation {
float: left;
margin-left: 0;
width: 100%;
display: block;
height: auto;
padding-top:20px;
font-family: 'Open Sans', sans-serif;
font-size:13px;
font-weight:200;
}
ul li {
display: inline;
list-style-type: none;
margin-left: 35px;
marginright: 4px;
float:right;
color:#FFF;
}
ul a {
text-decoration: none; /* no underline */
color:#FFF;
}
ul a:hover{
text-decoration:underline; /* no underline */
color:#FFF;
}
#body {
margin-left: 0;
width: 100%;
display: block;
height: 50px;
clear:both;
}
#footer {
clear: both;
float: left;
margin-left: 0;
width: 100%;
display: block;
padding-bottom:10px;
}
#FooterLeft {
clear: both;
float: left;
margin-left: 0;
width: 48.9795%;
display: block;
font-family: 'Source Sans Pro', sans-serif;
font-weight:200;
color:#FFF;
}
#FooterRight {
clear: none;
float: left;
margin-left: 2.0408%;
width: 48.9795%;
display: block;
}
#test{
clear:both;
height:1px;
}

#CALogo {
background-color:#039;
}


}

最佳答案

所以对于任何感兴趣的人,我都弄清楚了发生了什么......我愚蠢地使用了“body”的 id,它显然已经存在并且在样板中被玩弄......令人尴尬。

关于html - "Clear:Both;"不清除 float 的 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22584974/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com