官方出品的主题都称得上是精品,不少小伙伴都在使用。Twenty Fifteen 主题的使用者不在少数,随手写了这段代码可以让主题实现全站半透明效果。将代码放到主题style.css的结尾。

.hentry,.post-navigation,.comments-area,.site-footer,.page-header {
    background-color: rgba(255, 255, 255, 0.6);
}
button, input[type="button"], input[type="reset"], input[type="submit"]{
    background-color:rgba(51, 51, 51, 0.8);
}
.entry-footer,button, input, select, textarea{
	background-color:rgba(247, 247, 247, 0.6);
}
input:focus,textarea:focus{
	background-color:rgba(247, 247, 247, 0.8);
}
@media screen and (min-width: 59.6875em) {
	body:before {
		background-color: rgba(255, 255, 255, 0.6);
	}
}

透明度可以自行更改,效果如下。

关于半透明

不建议采用opacity的方法,它会让容器中的文字等也半透明。RGBA 颜色值不兼容老旧浏览器(IE8及以下),但个人博客无需考虑老旧浏览器的兼容性。

Comments | 捕获到 18 个小伙伴

上传图片
  1. datacollectors.co
    datacollectors.co Reply

    If some one desires to be updated with latest technologies afterward he must
    be pay a visit this web page and be up to date daily.

  2. Trimble Geo XT 3000 Series

    Greetings I am so delighted I found your blog page,
    I really found you by error, while I was searching on Digg for something else, Nonetheless I am here now and
    would just like to say thanks a lot for a tremendous post and a all
    round enjoyable blog (I also love the theme/design),
    I don’t have time to go through it all at the moment but
    I have book-marked it and also added your RSS feeds, so when I have time I will be back to read more, Please do keep up the excellent b.

  3. Used Power Level SDL30

    Hey! This is kind of off topic but I need
    some advice from an established blog. Is it difficult to set up your
    own blog? I’m not very techincal but I can figure things out pretty quick.
    I’m thinking about setting up my own but I’m not sure where to begin.
    Do you have any points or suggestions? Thanks

  4. S5
    S5 Reply

    Simply want to say your article is as surprising.
    The clarity in your submit is just cool and that
    i can assume you’re a professional on this subject.

    Fine along with your permission allow me to clutch your RSS
    feed to stay updated with imminent post. Thank you a million and
    please carry on the enjoyable work.

  5. R8 Model 2
    R8 Model 2 Reply

    Sweet blog! I found it while surfing around on Yahoo News.
    Do you have any tips on how to get listed in Yahoo News?
    I’ve been trying for a while but I never seem to get there!
    Thank you

  6. Leica ScanStation P16

    I relish, cause I discovered exactly what I was taking
    a look for. You have ended my 4 day long hunt!
    God Bless you man. Have a nice day. Bye

  7. Leica ICON grade iGx3 Data Sheet

    Hi there just wanted to give you a quick heads up.
    The words in your article seem to be running off the screen in Safari.

    I’m not sure if this is a format issue or something to do with internet browser
    compatibility but I thought I’d post to let you know.
    The design and style look great though! Hope you get the issue solved soon. Many thanks

  8. FX-101
    FX-101 Reply

    I’ve learn a few excellent stuff here. Definitely value bookmarking
    for revisiting. I wonder how a lot effort you place to create such a magnificent informative
    site.

Back