Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the translucency of web page background by CSS

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of "how to achieve translucent web background in CSS". The editor shows you the operation process through an actual case. The method of operation is simple and fast, and it is practical. I hope this article "how to achieve translucent web background in CSS" can help you solve the problem.

1. Introduction of DIV CSS semi-enlightened background

Set the equipment DIV semi-transparent CSS code:

Div {filter:alpha (Opacity=80);-moz-opacity:0.5;opacity: 0.5;}

Clarify: 1. Filter: set a semi-transparent filter for win IE, filter:alpha (Opacity=80) represents the object 80% translucent, Firefox does not recognize 2,-moz-opacity: achieve translucency for mozilla firefox Firefox reader, win IE does not recognize this attribute,-moz-opacity:0.5 equals to set semi-transparent to 50% 3, opacity: agree to include google for all hunting devices except IE, put the end mainly for google reader, opacity:0.5 Performance setting 50% translucent

In order to observe the semi-transparent implementation of DIV, we configure two DIV layers, one of which is placed in the other DIV layer, and the outer DIV is named ".div-a". The following layer CSS class is named ".div-b", resulting in the ".div-b" box in ".div-a".

We set a background for the underlying DIV to be a picture, and the DIV box below sets the village black.

II. Examples of translucent styles not configured

1. According to the description example, the semi-colorless HTML source code is not configured:

Semi-colorless instance online demonstration css5.com.cn. Div-a {background:url (div-a-bg.png) no-repeat;width:230px;height:136px;padding:10px;}. Div-b {background:#000;width:200px;height:100px;padding:5px;color:#F00} DIV semi-colorless instance demonstration

2. Screenshot of translucent CSS style is not set:

3. An example of setting up equipment and furnishing CSS semi-transparent items for DIV

1. We exit the semi-colorless pattern code for the ".div-b" selector:

Filter:alpha (Opacity=60);-moz-opacity:0.6;opacity: 0.6

Configure 60% translucent score

The HTML code of the broken example web page is as follows:

Online demonstration of translucent examples css5.com.cn. Div-a {background:url (div-a-bg.png) no-repeat;width:230px;height:136px;padding:10px}. Div-b {background:#000;width:200px;height:100px;padding:5px;color:#F00; filter:alpha (Opacity=60);-moz-opacity:0.6 Opacity: 0.6} / * CSS description: the CSS code is wrapped here so that the code will be displayed completely here, and the CSS performance will not be affected after the line break * / implementation of DIV semi-colorless example demonstration

2. Take a screenshot of the achievement of the hunter:

This is the end of the content about "how to achieve semi-transparent web background in CSS". Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report