2012-09-17 112 views
0

我有一些問題與IE 9和CSS。我想要做一個像日常生活一樣的菜單(只是不是每天開玩笑),並得到一些我從未有過的錯誤。我有2個問題的截圖。首先IE 9: Problem IE9ul,li菜單 - IE9填充頁邊距?

在這裏,我們有我想要它,得到它在Firefox,Chrome中,Safari瀏覽器: No Problem Firefox,Chrome,Safari

這裏是整個菜單的事情CSS:

#menu { 
background: white url(images/menu.jpg); 
width: 940px; 
height: 58px; 
margin: 40px auto; 
} 
#menu ul { 
margin: 0px 0px 0px -50px; 
padding: 0px 0px 0px 0px; 
list-style: none; 
line-height: normal; 
text-align: center; 
} 
#menu li { 
list-style: none; 
line-height: normal; 
float: left; 
margin-left: 160px; 
} 
#menu a { 
display: block; 
float: left; 
height: 55px; 
padding: 0px 30px 0px 30px; 
line-height: 56px; 
letter-spacing: 1px; 
text-decoration: none; 
text-transform: uppercase; 
font-family: 'Oswald', sans-serif; 
font-size: 19px; 
font-weight: normal; 
color: #B5B5B5; 
border: none; 
} 
#menu .current_page_item a { 
color: #FFFFFF; 
} 
#menu a:hover { 
text-decoration: none; 
color: #FFFFFF; 
} 

這裏是菜單的HTML代碼:

<div id="menu"> 
     <ul> 
      <li><a href="index.html"><strong>Startseite</strong></a></li> 
      <li><a href="programm.html"><strong>Programm</strong></a></li> 
      <li><a href="karten.html"><strong>Karten</strong></a></li> 
      <li class="current_page_item"><a href="#"><strong>Sponsoren</strong></a></li>    
     </ul> 
</div> 

我希望有人能幫助我這個..

BTW:http://adtime.agasoft.net/bako那裏你可以找到整個HTML頁面的東西! :)標籤之前

+1

你有一個'浮動:center'在'#menu li'。中心不是float的有效選項。 – cimmanon

+0

您的標記的第一行是聲明XML,但您不是以XML或XHTML的形式爲此提供此頁面。 – Rob

回答

1
<?xml version="1.0" ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

此代碼和IE9效果很好... :)