Summary of CSS hack technology usage
What is a CSS Summary of CSS hack technology usage?
In web development, we often encounter inconsistent performance among browsers. Because browsers from different manufacturers or different versions of a certain browser have different support and parsing of CSS. ,lead to Inconsistent page display effects are presented in different browser environments. At this time, in order to obtain a unified page effect, we need to write specific CSS styles for different browsers or different versions. , we call this process of writing corresponding CSS code for different browsers/different versions CSS Summary of CSS hack technology usage!
Let’s talk about the use of CSS Summary of CSS hack technology usage technology:
CSS Summary of CSS hack technology usage technology
css Summary of CSS hack technology usage classification
has three forms of expression, css attribute prefix method, selector prefix method, and IE conditional comment method.
Attribute prefix method (i.e. class internal Summary of CSS hack technology usage)
Selector prefix method
IE conditional comment method
css Summary of CSS hack technology usage generally has a wide range of applications and is recognized. Strong css definition is at the front.
2. Use CSS Summary of CSS hack technology usage technology to solve browser compatibility issues
CSS Hack has roughly three forms of expression: CSS attribute Hack, CSS selector Hack and IE conditions Note Hack, Hack is mainly targeted at IE browser.
a. Attribute-level Hack: For example, IE6 can recognize underline "_" and asterisk "*", IE7 can recognize asterisk "*", but not underline "_", and firefox cannot recognize both. Wait
b. Selector-level Hack: For example, IE6 can recognize *html .class{}, IE7 can recognize *+html .class{} or *:first-child+html .class{}. Wait
c. IE conditional comment Hack: For example, for all IE: , for IE6 and below: , this type of Hack is not only effective for CSS, but also for all codes written in the judgment statement. .
3. Introduction to CSS Summary of CSS hack technology usage writing methods in different browsers
The difference between IE6 and FF:
backgroundrange;*blue;
The difference IE6 and IE7:
background:green !important;blue;
The difference between IE7 and FF:
backgroundrange; *background:green;
The difference between FF, IE7, and IE6:
backgroundrange;*background:green !important;*blue;
Under normal circumstances, we try to avoid using CSS Summary of CSS hack technology usages, but in some cases, Summary of CSS hack technology usages are used as a last resort in order to consider the user experience and achieve backward compatibility. For example, because IE8 and below versions do not support CSS3, and our project page uses a lot of new CSS3 properties to render normally under IE9/Firefox/Chrome. In this case, if you do not use css3pie or htc or conditional comments, etc., it may You have to let IE8-'s exclusive Summary of CSS hack technology usage come into play. Although using Summary of CSS hack technology usages is good for the consistency of page performance, excessive abuse will cause confusion in HTML documents and increase the burden of management and maintenance.
5. CSS Summary of CSS hack technology usage
Because different browsers, or even different versions of the same browser, have different understandings of CSS parsing, the generated page effects are inconsistent. Writing CSS code for different browsers is called CSS Summary of CSS hack technology usage.
There are three commonly used CSS Summary of CSS hack technology usages, CSS internal Summary of CSS hack technology usages, selector Summary of CSS hack technology usages, and HTML header references, of which the first is the most commonly used.
6. CSS Hack Collection Summary
Block IE browser (that is, it will not be displayed under IE)
*:lang(zh) select { font:12px !important;} /*Special for FF*/
select:empty
{font:12px !important;} /*Visible in safari*/
Select here is the selector, which can be changed according to the situation. The second sentence is unique to the Safari browser on MAC.
only
IE7 identification
Related questions and answers
1. css Summary of CSS hack technology usage question
2. A question about IE version HACK
[Related recommendations]
1. PHP Chinese website Free video tutorial: "php.cn Dugu Jiujian (2)-css video tutorial"
The above is the detailed content of Summary of CSS hack technology usage. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

Using Bootstrap in Vue.js is divided into five steps: Install Bootstrap. Import Bootstrap in main.js. Use the Bootstrap component directly in the template. Optional: Custom style. Optional: Use plug-ins.

There are two ways to create a Bootstrap split line: using the tag, which creates a horizontal split line. Use the CSS border property to create custom style split lines.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

How to use the Bootstrap button? Introduce Bootstrap CSS to create button elements and add Bootstrap button class to add button text

To adjust the size of elements in Bootstrap, you can use the dimension class, which includes: adjusting width: .col-, .w-, .mw-adjust height: .h-, .min-h-, .max-h-

To set up the Bootstrap framework, you need to follow these steps: 1. Reference the Bootstrap file via CDN; 2. Download and host the file on your own server; 3. Include the Bootstrap file in HTML; 4. Compile Sass/Less as needed; 5. Import a custom file (optional). Once setup is complete, you can use Bootstrap's grid systems, components, and styles to create responsive websites and applications.

There are several ways to insert images in Bootstrap: insert images directly, using the HTML img tag. With the Bootstrap image component, you can provide responsive images and more styles. Set the image size, use the img-fluid class to make the image adaptable. Set the border, using the img-bordered class. Set the rounded corners and use the img-rounded class. Set the shadow, use the shadow class. Resize and position the image, using CSS style. Using the background image, use the background-image CSS property.
