2014-03-27 45 views
0

我想使用rgba代碼將我的站點的標題透明化。但它不起作用。你能幫我解決這個問題嗎? 在此先感謝!如何製作透明標題?

有報頭的代碼:

/*==================== 3. Header ====================*/ 

.site { 
    margin: 0 auto; 
    width: 100%; 
    position: relative; 
} 
.site.full-banner { 
    padding-top: 0; 
} 
.site-main { 
    margin-bottom: 70px; 
} 
body.page-template-page-landing-php { 
    overflow: hidden; 
} 
.landing.site-main { 
    margin: 0; 
    padding: 0; 
    position: fixed; 
    left: 0; 
    right: 0; 
    top: 0; 
    bottom: 0; 
    overflow: hidden; 
} 
.archive.woocommerce-page .site-main { 
    margin-bottom: 80px; 
} 
.site-header { 
    width: 100%; 
    z-index: 10000; 
} 
.full-banner .site-header { 
    position: absolute; 
    top: 0; 
} 
.site-header.header-1{ 
    background: url('../images/header_bg.png') !important; 
} 
.site-header.header-2 { 
    background: rgba(218, 202, 202, .5); 

} 
.header-relative .site-header { 
    position: relative; 
} 
.header-absolute .site-header { 
    position: absolute; 
} 

/*========== 3.1 Header Top ==========*/ 
.header-top { 
    line-height: 15px; 
    min-height: 35px; 
} 
.header-2 .header-top { 
    min-height: 36px; 
} 
.site-header, 
.site-header a, 
.toplinks a, 
.mini-cart .mobile-hide .subtotal .amount { 
    color: #dadada; 
} 
.header-2 .header-top { 
    border-bottom: 1px solid #242424; 
    -webkit-box-shadow: 0 1px 0 rgba(128,128,128,.15); 
     -moz-box-shadow: 0 1px 0 rgba(128,128,128,.15); 
      box-shadow: 0 1px 0 rgba(128,128,128,.15); 
} 
.header-2 .header-container { 
    min-width: 750px; 
} 
.main-header.fixed { 
    position: fixed; 
    background: rgba(218, 202, 202, .5); 
    width: 100%; 
    height: 77px; 
    left: 0; top: -7px; 
    z-index: 10000; 
} 
.main-header.fixed .navbar { 
    background: none; 
} 

.main-header.fixed .header-top { 
    display: none; 
} 

#primary { 
    width: 75%; 
    margin: 0; 
    float: left; 
} 
.full-width #primary { 
    width: 100%; 
    float: none; 
} 
#primary { 
    width: 100%; 
} 
.left-sidebar #primary { 
    width: 75%; 
    float: right; 
} 
.right-sidebar #primary { 
    width: 75%; 
    float: left; 
} 

.entry-header, 
.entry-content, 
.entry-summary, 
.entry-meta { 
    margin: 0 auto; 
    width: 100%; 
} 
.entry-header h1 { 
    font-size: 15px; 
} 
+0

您的rgba代碼看起來很好,但這隻適用於IE,Chrome,Firefox和Safari的更高版本。 IE 8絕對不會支持rgba。 – mituw16

回答

0

在CSS 3,他們引入不透明度。

opacity: 0.9; 

它從0.0(不可見)到1.0(不透明)的值。 讓我知道,如果它不適合你。 :-)

P.S.不確定瀏覽器的兼容性是什麼,但到目前爲止它對我來說很合適。

+0

不透明度將應用於整個元素以及元素內部的所有元素,而不僅僅是op所建議的顏色。 – mituw16