[英]CSS looks bad in IE
我在IE中遇到CSS問題
該頁面在Firefox,Chrome,Opera ....中看起來不錯。但是在IE上,“日期欄”與第一個<li>
欄重疊
此處: http : //www.animefushigi.com/latest-episodes
CSS如下:
#content h2.other-posts {
height: 31px;
font-size:12px;
line-height: 31px;
background: #2c2b2b;
padding: 0 10px;
border: 1px solid #1b1b1b;
color: #888888;
margin-bottom:1px;
}
#content #other-posts {
list-style: none;
padding: 1px;
margin-top:15px;
margin-bottom:15px;
margin-left: 20px;
}
#other-posts li {
list-style: none;
background: #151515;
height: 30px;
line-height: 30px;
border-left: 1px solid #050505;
border-right: 1px solid #151515;
border-bottom: 1px solid #050505;
border-top:1px solid #0f0f0f;
margin-bottom: 1px;
padding: 0 10px;
}
#other-posts li a {
float: left;
}
Wordpress PHP文件如下:
<ul id="other-posts">
<?php
$postslist = get_posts('numberposts=50&order=desc&orderby=date');
foreach ($postslist as $post) : setup_postdata($post);
?>
<?php the_date('', '<h2 class="other-posts">Added on ', '</h2>'); ?>
<li><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>">
<?php the_title(); ?>
</a></li>
<?php endforeach; ?>
</ul>
如何使這個全瀏覽器友好的?
我建議您使用IE特定的條件注釋。 這樣,您可以使用IE特定的樣式表來定位IE特質。
<!--[if IE]><link rel="stylesheet" type="text/css" href="ie/specific/css.css"> <![endif]-->
嘗試:
#other-posts li { display:inline }
而不是將顯示規則應用於“ li a”。 這是您要內聯顯示的列表項,而不是其中的鏈接。
編輯:非常抱歉。 鄧不知道“沒有”的來源。
嘗試刪除浮動元素並指定列表的寬度或高度。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.