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 implement HTML to support png transparent pictures

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

Share

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

This article mainly introduces "HTML how to support png transparent pictures". In daily operation, I believe many people have doubts about how to support png transparent pictures in HTML. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "how HTML supports png transparent pictures". Next, please follow the editor to study!

I. the JS document is required to approve

1. DD_belatedPNG.js and DD_belatedPNG_0.0.8a.js files are required. Below, we will provide packaged downloads.

2. It is important to introduce these 2 JS files on the demand approval png image html page (2 js files let's put them into the js folder as an example)

Since it is for IE6, and the later version of the reader does not need to use this special effect, we apply the declarative if condition to let IE6 read the JS file as follows:

The above code is for ie6 html comments, and ie6 will read and analyze the code in the above if premise comments. This allows IE6 to introduce critical JS files and code. The above code can be put into the html page.

Second, it is necessary to declare the class in the web page using PNG pictures.

We introduced JS, and we exited the code:

DD_belatedPNG.fix ('')

1. We apply png transparent image design in css backend attributes. If we apply png images to ".CSS5 {...}", we only need to make the following class declaration in "DD_belatedPNG.fix ('');" at this moment, corresponding to the code:

DD_belatedPNG.fix ('.CSS5')

2. We apply img tags in html using png clear pictures to manipulate if the img we apply in the .CSS5 box introduces the png image intention code:

DD_belatedPNG.fix ('.CSS5 img')

To sum up the above two points, when both situations are encountered, the code:

DD_belatedPNG.fix ('.CSS5 img,.CSS5')

In other words, we can use lowercase comma merging in the center of echo Ming, and so on, if we encounter multiple applications of png in a html page, whether it is CSS background or html img tag, we will probably use comma spread combination statement.

At this point, the study on "how HTML supports png transparent pictures" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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