Which CSS hacker do you use most often and which one do you avoid using?

Which CSS hacker do you use most often and which one do you avoid using?

I ask this question to understand the different views of different people on CSS hacks, as well as to understand which hacks are good and which are not.

+4
source share
7 answers

Not technically a hack, but I often include conditional comments in the target IE 7:

<!--[if lte IE 7]> <link href="ie7.css" /> <![endif]--> 

I really am leaving without using a lot of hacks.

+3
source

The most used is to clear the patch

The most hateful are !important rules, because they are a sign that the stylesheet is probably not organized properly. It also means that some styles are too general what they should be. Not good for performance.

+1
source

I mainly use min-height hack and don't use an underscore trick like _margin , which targets IE6.

0
source

I found that if I use the strict XHTML 1.0 doctrine, basically everything works ... However, I really do nothing ... But a good minimalistic site such as SO would be a pretty simple design without hacks ...

0
source

PNG transparency in IE6 using AlphaImageLoader () ...

versions of IE> 6, and Firefox and Chrome support all 8-bit transparent PNGs, but for compatibility with IE6 you must do the above css hack. Your CSS file will no longer be validated, but if you rely on transparent PNGs like me, it's worth it.

0
source

Most used: negative fields

0
source

This seems to be what I should use most often: create a CSS class .inline-block { display: inline-block; } .inline-block { display: inline-block; }

use it to style any element that you want to display as an inline block (instead of directly using display: inline-block; ). Then in your file only for IE (v.7 or earlier?):

 .inline-block { zoom: 1; *display: inline; } 

Sad panda.

0
source

Source: https://habr.com/ru/post/1302564/


All Articles