2012-12-09 41 views
1

我需要幫助搞清楚爲什麼我的div類=「內容」無法顯示正確的IE7 & IE8起來 - 在IE9看起來不錯:http://kathykroening.com/IE8和IE7 CSS問題與股利和定位

內容應該有一個黑暗的背景覆蓋,但它似乎並沒有通過,並且定位不正確,或者標題出現在頂部應該在下面。

下面是HTML:

<body class="home page page-id-81 page-template-default"> 

    <div id="wrapper"> 

     <header> 
      <div class="toph"> 
       <h1 class="logo"><a href="http://kathykroening.com">Kathy Kroening</a></h1><!-- /.logo --> 
      </div> 
      <div class="bottomh"> 
       <nav class="main"> 
<ul class="inner"><li id="menu-item-194" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-81 current_page_item menu-item-194"><a href="http://kathykroening.com/">Home</a></li> 
<li id="menu-item-151" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-151"><a href="http://kathykroening.com/about-kathy/">About Kathy</a></li> 
<li id="menu-item-152" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-152"><a href="http://kathykroening.com/experience/">Experience</a></li> 
<li id="menu-item-153" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-153"><a href="http://kathykroening.com/ideas/">Ideas</a></li> 
<li id="menu-item-156" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-156"><a href="http://kathykroening.com/open-house/">Open House</a></li> 
<li id="menu-item-155" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-155"><a href="http://kathykroening.com/cabinetry/">Cabinetry</a></li> 
</ul> 
       </nav><!-- /.main --> 
       <nav class="crumbs"> 
       </nav><!-- /.crumbs --> 
      </div> 
     </header><!-- /header --> 

     <section id="container"> 
       <img src="http://kathykroening.com/wp-content/uploads/2012/11/homebg.jpg" alt="" class="pagebg"> 



     <div class="inner"> 
      <div class="content"> 

       <p>Before color, fabric and furnishing, there’s interior architectural design – the essential space planning that literally makes room for your ultimate vision.</p> 

      </div> 
     </div> 

     <div class="caption"> 
      <h2>Interior Architectural Design</h2> 
     </div><!-- /.caption --> 
       </section><!-- /#container --> 



    </div><!-- /#wrapper --> 


</body> 

這裏是CSS:

* { margin: 0; padding: 0;} 
html { height: 100%; overflow: auto;} 
body { font-family: 'Questrial', sans-serif; font-size: 12/13px; line-height: 115%; } 
a { text-decoration: none; outline: none !important;} 

.alignleft { float: left;} 
.alignright { float: right;} 

#wrapper { width: 1024px; margin: 0 auto; position: relative; display: block;} 
.inner { width: 900px; margin: 0 auto; position: relative; } 

header { height: 215px; overflow: hidden;} 
.toph { height: 150px; line-height: 150px; text-align: center;} 
.logo a { display: inline-block; width: 360px; height: 96px; background: url('assets/img/logo.png') no-repeat; text-indent: -9999px; position: relative; line-height: 96px;} 
.bottomh { height: 65px;} 
header ul { list-style: none;} 
header nav { clear: both; display: inline-block; width: 100%; position: relative;} 
header nav li { float: left;} 
header nav li a { text-transform: uppercase; font-size: 14px; } 
nav.main { height: 35px; background: url('assets/img/mainnavbg.jpg') no-repeat; line-height: 35px;} 
nav.main li { padding: 0 45px;} 
nav li.first { padding-left: 0 !important; border-left: 0 !important;} 
nav li.last { padding-right: 0 !important; border-right: 0 !important;} 
nav.main li.last { float: right;} 
nav.main a { color: #fff;} 
nav.main a:hover, 
nav.main li.current_page_item a, 
nav.main li.current-page-ancestor a { border-bottom: 1px solid #fff; padding-bottom: 3px;} 
nav.crumbs a { color: #726658; font-size: 13px;} 
nav.crumbs ul { height: 13px; line-height: 13px; padding: 3px 0;} 
nav.crumbs a:hover, 
nav.crumbs li.current_page_item a { color: #90492d;} 
nav.crumbs li { padding: 0 10px; border-right: 1px solid #e1dedb; border-left: 1px solid #716558;} 

footer { margin-top: 5px; height: 30px; line-height: 30px; clear: both; font-size: 12px; color: #797979; } 

section#container { height: 550px; position: relative; display: block;} 
.pagebg { position: absolute; z-index: 1; } 
.pagebg.block { right: 45px;} 
.content { z-index: 999; position: absolute; left: -50px; width: 250px; height: 470px; background: rgba(0,0,0,0.8); color: #fff; padding: 40px 35px;} 
.scroller { height: 500px; overflow: auto; width: 250px;} 
.content.block { background: #262223;} 
.content h2 { font-weight: 100; text-transform: uppercase; font-size: 21px; margin-bottom: 10px;} 
.content h3 { text-transform: uppercase; font-size: 15px; font-weight: 100; padding: 3px 5px; background: #58595b; display: inline-block; margin-bottom: 10px;} 
.content p { font-size: 14px; padding-bottom: 10px; } 
.content a { color: inherit; text-decoration: underline; } 
.content ul { list-style-position: inside;} 

body.home .content p { font-size: 19px; line-height: 150%;} 
.caption { background: rgba(255,255,255,.8); padding: 10px 5px; position: absolute; bottom: 20px; width: 100%; text-transform: uppercase; z-index: 9999;} 
.caption h2 { width: 875px; margin: 0 auto; font-size: 17px; letter-spacing: 20px; font-weight: 100;} 
+1

請僅發佈相關代碼。 – rcdmk

+0

IE7和IE8不支持HTML5標籤,如

,

回答

1

這裏有三件事情可以做,以提高你的情況。

1)使用normalize.css而不是* { margin:0; padding:0;}進行css重置。這將有助於添加對HTML5中添加的標籤,如節,文章,標題等的支持。

2)使用html5shiv這完成了對ie8和更低版本未知的html5元素的支持,並允許您對它們進行樣式設置。

3)對於在較低的IE RGBA支持看看這篇文章cross browser rgba support

添加它看起來像你的造型一個WordPress主題很好的措施,我建議以下的準則格式化你的CSS 。 Wordpress CSS Coding Standards

1

您的第一個問題是IE 9以下版本不瞭解RGBA顏色。

的解決方法是使用過濾器漸變背景,但使用相同的顏色兩側:

background-color: rgba(0, 0, 0, 0.75); /* R G B Alpha */ 
filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#BF000000', EndColorStr='#BF000000'); /* Alpha R G B */ 

注意,過濾器採取第一2個字符作爲阿爾法的十六進制值,00之間和FF。

一個簡單的方法來獲得所需的值是做一些簡單的計算:

alpha: 
    range: 0 - 1 
    value: 0.75 

hexa: 
    range: 00 - FF = 0 - 255 
    value: 0.75 * 255 = 191 = BF 

要想從一個十進制的十六進制值,您可以使用Windows計算器編程模式下,一些工具,如Photoshop的顏色選擇器或任何在線轉換器工具(即使谷歌可以做到這一點:https://www.google.com/?q=191+to+hex

您的第二個問題是,下面的IE 9不支持HTML 5標籤。

你可以使用一些工具來解決這個問題,這樣的:

等等...

我強烈推薦使用http://html5boilerplate.com/