
我在wordpress站点最近的一个post小部件中显示了一个很长的标题,因为当链接太长时,它会中断到另一行,但是这条新行会把第一行搞乱,因为第二行在上面。我尝试将这个CSS行line-height: 1.6em;添加到.widgettitle li中,但是没有工作,并且尝试了一些可能与名称相关的类。没有成功,那我做错了什么?
我只能通过期望元素看到应用于此框的类,这是http://experiencias.freeserver.me/的URL。我没有在我的索引页面或头代码中看到这个类名。
.widgettitle {
color:#fff;
background-color:#cc3234;
border: 1px #D9D9D9 solid;
font-size:20px;
padding-left:5px;
box-shadow: rgba(0,0,0, 0.1) 0px 0px 5px;
-moz-box-shadow: rgba(0,0,0, 0.1) 0px 0px 5px;
-webkit-box-shadow: rgba(0,0,0, 0.1) 0px 0px 5px;
}
.textwidget {
list-style-type: none;
font: 14px/16px Helvetica, Arial, sans-serif;
padding:5px;
line-height: 1.6em;
}
.widget {
overflow:hidden;
padding: 0 0 10px 10px;
margin: 0 0 10px;
}
.widget .date {
font-size:11px;
}
.widget h4 {
font-weight:normal;
}
.widget .sub-menu {
margin-left:10px;
}
.widget .sub-menu li{
margin-left:5px;
}
.widget .menu-main-container li{
list-style-type:square;
margin-left:15px;
}
.recent-posts li, .tweet-list li {
border-bottom: dotted 1px #555;
padding-bottom: 8px;
margin-bottom: 8px;
}
.recent-posts li:last-child {
border-bottom:none !important;
padding-bottom:none;
margin-bottom:none;
}
.recent-posts h3 {
font-weight: 600;
font-size: 12px;
}
.recent-posts h5 {
font-size: 11px;
font-family: Helvetica, Arial, sans-serif;
}发布于 2014-05-30 01:21:55
与其将line-height值赋给.widgettitle li,不如将其给.widget_recent_entries li a。
问题是,您没有以足够的特异性向选择器声明样式。我怀疑a标记之前继承了#侧栏-次要li中的line-height。
https://stackoverflow.com/questions/23945445
复制相似问题