Click to See Complete Forum and Search --> : IE input text boxes and italics with css - changes box width


deco10
07-17-2009, 01:39 PM
Hi

I have a text box that starts with text in it. "Search Here" it says. When the user clicks in the box I use javascript (jquery) to clear the text and change the class (the class when the user clicks in the box makes the font-style normal and the color black, otherwise the text is italic and grey). So when I click in the box in IE, the italics are removed and the box gets a few pixels wider, which is really annoying.

Is this a known issue or have I got something bass-ackwards here?

Kyrik
07-18-2009, 03:27 PM
I think your problem is the font change. When it switches from italic to normal, the font gets a little bit bigger because italic fonts are generally smaller than normal font. Um....you could try setting a font size in your class so that way the font is the same size when it changes. If that doesnt work, you can always set a height and width for your text field, that way the text field remains the same when its class gets changed.

Or I could be horribly wrong...haha, but its worth a try.

Andyram2k
07-18-2009, 05:40 PM
Hi Deco10,
Have you got a live example or code, so we can see what is happening please? Cheers.

- Andy.