Safari ways

CSS hack for Safari

, on June 08, 2008

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;
}}
Anonymous's picture
thank you, it worked instantly!

Mihai's picture
i am glad it helped

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.