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 solve the problem of CSSHack and float closure

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly explains "how to solve the problem of CSSHack and float closure". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to solve the problem of CSSHack and float closure.

CSS skills: about CSSHack and float closure

1. CSSHACK

The following two methods can solve almost all HACK.

1,!important

With IE7's support for! important, the! important method is now only targeted at IE6's HACK. Pay attention to the way you write. Remember that the location of the declaration needs to be advanced.)

ExampleSourceCode

# wrapper {width 100pximportant; width:80px;}

2jigme IE6max IE7 pair of FireFox

* + html and * html are IE-specific tags, which are not supported by firefox. And * + html is a unique tag for IE7.

ExampleSourceCode

# wrapper {# wrapper {width:120px;} * html#wrapper {width:80px;} * + html#wrapper {width:60px;}}

Note:

* + html must ensure that the HACK of IE7 has the following declaration at the top of HTML:

2. Float closure (clear float)

Add the following code to the GlobalCSS and add class= "clearfix" to the div that needs to be closed.

ExampleSourceCode

Clearfix: after {content: "."; display:block; height:0; clear:both; visibility:hidden;} .clearfix {display:inline-block;} .clearfix {display:block;} so far, I believe you have a better understanding of "how to solve the problem of CSSHack and float closure". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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