0

I have a input[type="text"] that has padding applied to it and it behaves differently in firefox PC then on a mac.

Can I debug this inconsistency with JavaScript? Based on the code below, does anyone have any sugestions to resolve my issue?

Firefox on Windows (firebug inspection)

.searchContainer input {
   border-color:#7C7C7C #C3C3C3 #DDDDDD;
   border-style:solid;
   border-width:1px;
   color:#555555;
   float:left;
   height:12px;
   padding:3px;
  }

Firefox on Mac(firebug inspection)

.searchContainer input  {
   border-color:#7C7C7C #C3C3C3 #DDDDDD;
   border-style:solid;
   border-width:1px;
   color:#555555;
   float:left;
   height:12px;
   padding:3px;
 }

No other styles are applied to these inputs.

Any suggestions?

1
  • oops, its the second one! they are both the same. Commented Jun 10, 2010 at 20:44

4 Answers 4

2

You don't seem to be setting a font-size. When you force a height on an input field, you should specify one. It's perfectly conceivable that Macs and PCs have different standard font sizes for input elements.

That said, it's probably better to define the height of the input by setting padding and font-size but no height at all. That way, the browser can handle it easier if the user is using an enlarged font (or the "Text zoom" function in Firefox).

Sign up to request clarification or add additional context in comments.

Comments

2

Since you're specifying the input's height in pixels, you'll probably also want to specify the font size in pixels. It looks like platform-specific font rendering may be the culprit here.

Comments

2

It looks like it could be an issue with the font size in the input text box (and maybe the buttons, too). Setting the font size (and even the font family) may solve the problem.

Comments

1

Check navigator.platform in Javascript.

2 Comments

Ok, i will check out. Do u have any reason why this happens?
Thanks, i got to learn a new property of the navigator object.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.