How can I make my website's background transparent without making the content (images & text) transparent too?

前端 未结 8 1340
小鲜肉
小鲜肉 2020-12-15 04:25

I\'m doing a website for a school project, and I\'m currently having a small problem... I can\'t make the body\'s background transparent without it also affecting the conten

相关标签:
8条回答
  • 2020-12-15 05:26

    I would agree with @evillinux, It would be best to make your background image semi transparent so it supports < ie8

    The other suggestions of using another div are also a great option, and it's the way to go if you want to do this in css. For example if the site had such features as selecting your own background color. I would suggest using a filter for older IE. eg:

    filter:Alpha(opacity=50)
    
    0 讨论(0)
  • 2020-12-15 05:26

    Just include following in your code

    <body background="C:\Users\Desktop\images.jpg"> 
    

    if you want to specify the size and opacity you can use following

    <p><img style="opacity:0.9;" src="C:\Users\Desktop\images.jpg" width="300" height="231" alt="Image" /></p> 
    
    0 讨论(0)
提交回复
热议问题