Connecting Tech Pros Worldwide Forums | Help | Site Map

Netscape 7.x ID selector and Width Bug

Bryan
Guest
 
Posts: n/a
#1: Jul 21 '05
Hi All,

I can't find a solid answer for this. Maybe someone here will know.

I'm seeing a bug in Netscape 7.2 when I use a ID Selector to apply a
style to a text input field.

THIS WORKS:

<input type="text" name="test" style="width: 350px;">

THIS ALSO WORKS:

<style>
..MyStyle { width: 350px; }
</style>

<input type="text" name="test" class="MyStyle">

THIS DOES NOT WORK:

<style>
#MyStyle { width: 350px; }
</style>

<input type="text" name="test" id="MyStyle">

Any idea why? IE likes it well enough, but Netscape 7.x, Firefox 1.0
and Opera 6.x don't like it. Is there something invalid with this CSS?
I don't believe so.

Netscape Details (in case it matters):
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2)
Gecko/20040804 Netscape/7.2 (ax)

Thanks!

- Bryan


kchayka
Guest
 
Posts: n/a
#2: Jul 21 '05

re: Netscape 7.x ID selector and Width Bug


Bryan wrote:[color=blue]
>
> THIS DOES NOT WORK:
>
> <input type="text" name="test" id="MyStyle">[/color]

Posting a URL that shows the problem is usually a better idea than just
posting a code snippet. There may be more to this than you think.

I'll take a shot in the dark, though. Are use using id="MyStyle" on more
than one element in the page? If so, it's invalid. id's must be unique
to an element in a page. Use a class selector if you want it on multiple
elements.
[color=blue]
> IE likes it well enough,[/color]

That's not suprising, since IE ignores a lot of standards. ;)

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Bryan
Guest
 
Posts: n/a
#3: Jul 21 '05

re: Netscape 7.x ID selector and Width Bug



kchayka wrote:
[color=blue]
> I'll take a shot in the dark, though. Are use using id="MyStyle" on[/color]
more[color=blue]
> than one element in the page?[/color]

Darn it! You're right, that's it. Duh.

Thanks!

Closed Thread