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

Common CSS HACK problems and how to solve them

2025-04-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

Most people do not understand the knowledge points of this article "commonly used CSS HACK problems and how to solve them", so the editor summarizes the following contents, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "commonly used CSS HACK problems and how to solve" article.

1. Block IE browsers (also equal to not represented under IE)

*: lang (zh) select {font:12px! important;} / * Special use of FF * /

Select:empty {font:12px! important;} / * safari visible * /

Here select is the selector, following changes in the environment. The second sentence is unique to safari browsers on MAC.

2. Only IE7 recognizes hack

* + html {… }

This HACK can be accepted when you only need to make a style for IE7.

3. Identify CSS HACK under IE6 and IE6

* html {… }

This central government needs to be particularly stable. Many landowners have written that it is IE6's HACK. Indeed, IE5.x can also identify this HACK. The other hunting instruments are not recognized.

Html/**/ > body select {. }

This sentence has the same effect as the previous one.

4. Only IE6 does not recognize div hack

Select {display / * IE6 does not recognize * /: none;}

Here, the first thing is to gobble up an attribute and value through CSS, and interpret it before the colon.

5. Only IE6 identifies and approves

.yangshi {_ height:20px;}

Here IE6 is in favor of identifying the "_" short underscore before the CSS attribute.

6. Only IE6 and IE5 are not recognized.

Select/**/ {display / * IE6,IE5 does not recognize * /: none;}

The difference between this and the following sentence is that there is an additional CSS confession between the determiner and the curly braces.

7. Only IE5 does not recognize

Select/*IE5 does not recognize * / {display:none;}

This sentence is an indication that the attribute area is removed from the previous sentence. As long as the IE5 does not recognize

8. The box model plans to calculate the door path.

Selct {width:IE5.x width; voice-family: "\"}\ ""; voice-family:inherit; width: exact width;}

The removal of the door path of the box mold is not handled by important. You have to understand that.

9. Root out the float

Select:after {content: "."; display:block; height:0; clear:both; visibility:hidden;}

In Firefox, when the children are floating, then the height of the parent has no choice but to contain the whole child, then use this root-broken floating HACK to define the parent, then you can control the title.

10. Truncation ellipsis

Select {- oMut _ text _ over _ flow _ rides; text-overflow:ellipsis; white-space:nowrap; overflow:hidden;}

This is a good technique to cut off more than the department's calligraphy after exceeding the length, and to omit the end of the number. It's just that Firefox doesn't approve at the moment.

11. Only need Opera to identify

@ media all and (min-width: 0px) {select {. }}

Make your own settings for Opera readers.

The above usually write some HACK in CSS, these are usually used to plan local compatibility issues, if you want to include the compatibility content, you might as well try the following filters. Some of these filters are written in CSS to import special styles, while others are written in HTML to import the patch pattern that is probably needed through the premise link.

The above is about the content of this article on "commonly used CSS HACK problems and how to solve them". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please 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.

Share To

Development

Wechat

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

12
Report