Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

1 pixel vertical discrepancy between text on OSX and Windows

1 pixel vertical discrepancy between text on OSX and Windows

Problem

I have a pretty simple button that is marked up like this:


    Back to homepage

The computed style of the element looks like this: http://pastebin.com/u9q6BDHx

The computed style of the looks like this: http://pastebin.com/P9mR7yHF

Here's what it looks like in comparison, Windows vs. OSX:

As you can see, there's a one pixel discrepancy between Windows and everything else. The designers are requiring that this be a pixel-perfect implementation and I have no idea how to fix the problem specifically for OSX.

How can I fix this?

Problem courtesy of: Naftuli Kay

Solution

oYou're going to find that every browser will differ at least slightly in how it handles CSS. For instance, my company's website uses some crazy SEO "tricks" to get sections higher in the page as viewed by Goggle vs. where a user sees the info. As a result, some of the CSS I write requires browser-specific tweaks.

I believe what you're looking for is something along the lines of the following, allowing individual styles per browser to be used:

.win.ie .buttons {padding:3px 5px;}
.mac.gecko .buttons {padding:4px 5px;}
.chrome .buttons {padding:4px 6px;}
.win.gecko .buttons{padding:4x 6px;}
Solution courtesy of: Lazerblade

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

1 pixel vertical discrepancy between text on OSX and Windows

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×