In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to use CSS to achieve translucent web background, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
I. introduction to translucency of DIV CSS
Set the equipment DIV semi-transparent CSS code:
Div {filter:alpha (Opacity=80);-moz-opacity:0.5;opacity: 0.5;}
Note: 1. Filter: configure win IE with semi-clear filter attainments, filter:alpha (Opacity=80) represents the object 80% semi-clear, Firefox Reader does not recognize 2,-moz-opacity: mozilla firefox Firefox to achieve semi-colorless, win IE does not recognize this attribute,-moz-opacity:0.5 is equivalent to setting semi-colorless to 50% 3, opacity: for all hunting devices except IE, including Google, the end is mainly for google browser, opacity:0.5 Disclose the performance setting, equipment and equipment 50% and 50% of the equipment is half-clear.
In order to see the semi-transparent completion of DIV, we set up two DIV layers, leaving one in the other DIV layer, and the outer DIV is named ".div-a"; the layer CSS class trapped below is named ".div-b", which forms a ".div-b" box in ".div-a".
We configure a set for the underlying DIV is a picture, and the DIV box below sets the village color.
2. No semi-colorless pattern instance is configured.
1. According to the depicted example, the semi-colorless HTML source code is not set for equipment furnishings:
Online demonstration of semi-colorless example css5.com.cn
.div-a {bac kg round:url (div-a-bg.png) no-repeat;width:230px;height:136px;padding:10px;}
.div-b {bac kg round:#000;width:200px;height:100px;padding:5px;color:#F00}
Demonstration of DIV translucency example
2. Screenshot of semi-colorless CSS items without equipment:
3. An example of configuring CSS translucent pattern for DIV
1. We intervene in the semi-colorless pattern code for ".div-b" selectors:
Filter:alpha (Opacity=60);-moz-opacity:0.6;opacity: 0.6
Configure 60% translucent score
The HTML code of the incomplete instance web page is as follows:
Online demonstration of semi-Tongming example css5.com.cn
.div-a {bac kilogram round: url (div-a-bg.png) no-repeat;width:230px;height:136px;padding:10px}
.div-b {bac kg round:#000;width:200px;height:100px;padding:5px;color:#F00
Filter:alpha (Opacity=60);-moz-opacity:0.6;opacity: 0.6}
/ * CSS interpretation makes it clear: the CSS code is wrapped here in order to make the code appear complete here, and the CSS results will not be affected after the line break * /
Realize the demonstration of DIV semi-transparent example
2. Take a screenshot of the reader effect:
Summary: according to the above two examples, the first one is not equipped with translucent equipment, and the other is configured with a translucent name to complete the semi-transparent function of the div layer, and everyone may adjust the semi-achromatic value to achieve the desired semi-achromatic value. Setting the semi-transparent effect of equipment should consider the compatibility of hunting devices such as IE browser, Google, Firefox and so on, so our translucent code must be broken.
The above is all the content of the article "how to use CSS to achieve semi-transparent web background". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.