【发布时间】:2017-07-31 21:08:09
【问题描述】:
试图获取“菜单”下方的文本(如图 2 所示)。这样做的“正确”方法是什么?我一直在玩 meniubot 和文本框边距、填充、显示:块、显示:内联块、浮动:左、清除:两者,但我无法正确对齐,如第二张图片所示。
有什么想法吗?也许我应该为每个文本框使用不同的类并设置自定义边距?
我有什么:
它的外观:
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;
}
【问题讨论】:
-
你应该使用 list 而不是
这将完美地工作。
标签: html css alignment css-tables