LI 内 A 元素的垂直对齐
我在实施新设计时遇到问题。虽然锚元素在旧设计中正确对齐,但出于某种原因,锚元素在新设计中与底部对齐,其中 html/css 的 UL、LI 和 A 部分完全相同。
#treeview ul {
padding-top: 3px;
}
#treeview ul li {
background: none repeat scroll 0 0 transparent;
line-height: 24px;
padding-bottom: 3px;
padding-left: 0;
}
#treeview ul li.active {
background: none repeat scroll 0 0 #DDDDDD;
}
#treeview ul li ul li {
padding-left: 30px;
}
#treeview ul li a {
color: #444444;
padding-left: 5px;
text-decoration: none;
}
<div id="treeview">
<ul>
<li>
<img src="assets/js/no-expand.png">
<img class="icon" width="24" height="" src="assets/images/icons/icon_dance24x24.png">
<a title="Essential" href="/index/night-clubs/essential/">Essential</a>
</li>
</ul>
</div>
I have a problem with implementing a new design. While the anchor elements are aligned correctly in the old design, for some reason the anchor elements are aligned to the bottom in the new design with html/css regading the UL, LI and A part being exatly the same.
#treeview ul {
padding-top: 3px;
}
#treeview ul li {
background: none repeat scroll 0 0 transparent;
line-height: 24px;
padding-bottom: 3px;
padding-left: 0;
}
#treeview ul li.active {
background: none repeat scroll 0 0 #DDDDDD;
}
#treeview ul li ul li {
padding-left: 30px;
}
#treeview ul li a {
color: #444444;
padding-left: 5px;
text-decoration: none;
}
<div id="treeview">
<ul>
<li>
<img src="assets/js/no-expand.png">
<img class="icon" width="24" height="" src="assets/images/icons/icon_dance24x24.png">
<a title="Essential" href="/index/night-clubs/essential/">Essential</a>
</li>
</ul>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个...
Try this...
尝试:
Try: