safari

CSS hack for Safari

Generally Safari browser print a website layout the way i want. Some times thou, it won't do it as Firefox do.

This is an example hack for Safari. The css class inside @media screen and (-webkit-min-device-pixel-ratio:0){} will be read only by Safari. So, in Firefox the object that user this class will have a padding-left of 10px and in Safari i canceled the 10px padding by defining a new value (padding-left: 0px;)

.class {
width: 100px;
padding-left: 10px;
}
 
@media screen and (-webkit-min-device-pixel-ratio:0){
.class {
width: 100px;
padding-left: 0px;
}}

Syndicate content