This is an article about CSS HACK. The CSS HACK mentioned in this article is a HACK for attributes in class and id, and the order of arrangement has requirements. What I want to talk to you about today is CSS HACK for class and id.
.test{/*FF*/
height:20px;
background-color:orange;
}
* html .test{/*IE7*/
height:20px;
background-color:blue;
}
*html .test{/*IE6*/
height:20px;
background-color:black;
}
From the above CSS code, we can see that FF is still the most obedient browser. If you want to use HACK in IE6 and IE7, you must add the HTML tag in front. It's easy to remember here. IE6 adds *html, and IE7 adds *html, which implies that a version has been added. The advantage of CSS HACK done on class and id is that there is no need to take into account the order, and it is easy for management and other personnel to accept. It can also achieve similar JS browser version control through this HACK. The disadvantage may be that it generates a lot of code! Okay, let’s talk about these first.
After reading the above content, you can click on the effect below to see the effect in different browsers. Orange represents FF, blue represents IE7, and black represents IE6.
[Ctrl A Select all Note:If you need to introduce external Js, you need to refresh it to execute]

I got this question the other day. My first thought is: weird question! Specificity is about selectors, and at-rules are not selectors, so... irrelevant?

Yes, you can, and it doesn't really matter in what order. A CSS preprocessor is not required. It works in regular CSS.

You should for sure be setting far-out cache headers on your assets like CSS and JavaScript (and images and fonts and whatever else). That tells the browser

Many developers write about how to maintain a CSS codebase, yet not a lot of them write about how they measure the quality of that codebase. Sure, we have

Have you ever had a form that needed to accept a short, arbitrary bit of text? Like a name or whatever. That's exactly what is for. There are lots of

I'm so excited to be heading to Zürich, Switzerland for Front Conference (Love that name and URL!). I've never been to Switzerland before, so I'm excited

One of my favorite developments in software development has been the advent of serverless. As a developer who has a tendency to get bogged down in the details

In this post, we’ll be using an ecommerce store demo I built and deployed to Netlify to show how we can make dynamic routes for incoming data. It’s a fairly


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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Dreamweaver CS6
Visual web development tools

WebStorm Mac version
Useful JavaScript development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

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