尝试获取“菜单”下方的文本(如图2所示)。什么是“正确”的方式来做到这一点?我一直玩弄meniubot和文本框边距,填充,显示:块,显示:内联块,浮动:左,清除:两者,但我不能让它正确对齐,如第二张图片所示。HTML + CSS页脚 - 在菜单下格式化文本
任何想法?也许我应该为每个文本框使用不同的类并设置自定义边距?
我有什么:
什么它看起来像:
HTML:
<div id="footer">
<div class="main">
<div class="logo2">
<a href="#"><img src="logo2small.png"></a>
</div>
<div class="meniubot">
<a href="#1">naujienos</a>
<a href="#2">krepšinio vadovas</a>
<a href="#3">treniruotė</a>
<a href="#">įdomybės</a>
<a href="#">galerija</a>
<a href="#">apie mus</a>
</div>
<div class="ytfb2">
<a href="#"><img src="yttopedit.png"></a>
<a href="#"><img src="ftopedit.png"></a>
</div>
<div class="textbox">
Wondering <br> how we can he <br> Ip your game <br> Basketball HQ <br> Lomprehensive <br> Resource <br> Designed for basketball
</div>
<div class="textbox">
Wondering <br> how we can he <br> Ip your game <br> Basketball HQ <br> Lomprehensive <br> Resource <br>
</div>
<div class="textbox">
Wondering <br> how we can he <br> Ip your game <br> Basketball HQ <br> Lomprehensive <br> Resource <br> Desiasketball coach
</div>
<div class="textbox">
Wondering <br> how we can he <br> Ip your game <br> Basketball HQ
</div>
</div>
</div>
</body>
</html>
CSS:
#footer{
bottom:0px;
background-image:url(meniuBG.jpg);
height:252px;
margin-top:220px;
}
.logo2{
float:left;
margin-top:35px;
}
.ytfb2{
clear:both;
}
.ytfb2 a{
float:left;
margin-top:40px;
margin-right:20px;
}
.meniubot{
float:left;
margin-left:15px;
margin-top:40px;
}
.meniubot a{
text-align: center;
float:left;
text-decoration: none;
font-style:italic;
color:rgb(193,193,193);
padding:0px 35px 0px 35px;
text-transform:uppercase;
}
.textbox {
float:left;
margin-left:50px;
margin-top:-20px;
color:rgb(193,193,193);
font-size:14;
}
你应该使用列表,而不是
,这将完美的工作。 –