Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > id selector and IE

Reply
Thread Tools

id selector and IE

 
 
steven
Guest
Posts: n/a
 
      01-22-2004
Please have a look at http://users.pandora.be/nenya/anor2/0122.htm
I'm using an id selector to define a style for the paragraphs in a div:

div#div1 > p {
border-bottom: 1px solid #006699;
color:red;
margin-left: 20px;
}

ok in Mozilla, not ok in IE: the style is also applied to the paragraphs
outside the div. Other browsers?
Yet Another IE Bug? How can I fix this?
TIA

Steven


 
Reply With Quote
 
 
 
 
brucie
Guest
Posts: n/a
 
      01-22-2004
in post: <news:CHYPb.851$(E-Mail Removed)-ops.be>
"steven" <(E-Mail Removed)> said:


> div#div1 > p {
> ok in Mozilla, not ok in IE:


IE doesn't support child selectors


--
brucie - i usenet nude
 
Reply With Quote
 
 
 
 
Mark Parnell
Guest
Posts: n/a
 
      01-22-2004
On Thu, 22 Jan 2004 23:06:10 GMT, "steven" <(E-Mail Removed)>
declared in alt.html:

> div#div1 > p {
> border-bottom: 1px solid #006699;
> color:red;
> margin-left: 20px;
> }
>
> ok in Mozilla, not ok in IE:


IE doesn't support the child selector, >

Try

div#div1 p {
blah
}

Not a very descriptive ID, BTW.

> Yet Another IE Bug? How can I fix this?


You mean you actually need to ask?

--
Mark Parnell
http://www.clarkecomputers.com.au
 
Reply With Quote
 
steven
Guest
Posts: n/a
 
      01-22-2004

"Mark Parnell" <(E-Mail Removed)> wrote in message
news:1t673pwvti2wq$.10ow47ho43t2o$(E-Mail Removed). ..
> On Thu, 22 Jan 2004 23:06:10 GMT, "steven" <(E-Mail Removed)>
> declared in alt.html:
>
> > div#div1 > p {
> > border-bottom: 1px solid #006699;
> > color:red;
> > margin-left: 20px;
> > }
> >
> > ok in Mozilla, not ok in IE:

>
> IE doesn't support the child selector, >
>
> Try
>
> div#div1 p {
> blah
> }
>
> Not a very descriptive ID, BTW.


It's not the actual div's name. I made a small demo page to show the effect,
without too much clutter.

>
> > Yet Another IE Bug? How can I fix this?

>
> You mean you actually need to ask?



Thanx Mark. You too Brucie

Steven



 
Reply With Quote
 
Richard
Guest
Posts: n/a
 
      01-23-2004
steven wrote:

> Please have a look at http://users.pandora.be/nenya/anor2/0122.htm
> I'm using an id selector to define a style for the paragraphs in a div:


> div#div1 > p {
> border-bottom: 1px solid #006699;
> color:red;
> margin-left: 20px;
> }


> ok in Mozilla, not ok in IE: the style is also applied to the paragraphs
> outside the div. Other browsers?
> Yet Another IE Bug? How can I fix this?
> TIA


> Steven


I would strongly suggest not using a tag name as a class/id name.
use a more unique name such as ndiv or mydiv.
The system would not be confused trying to figure out what to do with it.

Why are wanting to color the bottom border of a paragraph?
Just use <hr>.


 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      01-23-2004
Quoth the raven named Richard:

> steven wrote:
>
> > Please have a look at http://users.pandora.be/nenya/anor2/0122.htm
> > I'm using an id selector to define a style for the paragraphs in a div:

>
> > div#div1 > p {
> > border-bottom: 1px solid #006699;
> > color:red;
> > margin-left: 20px;
> > }

>
> > ok in Mozilla, not ok in IE: the style is also applied to the paragraphs
> > outside the div. Other browsers?
> > Yet Another IE Bug? How can I fix this?
> > TIA

>
> > Steven

>
> I would strongly suggest not using a tag name as a class/id name.
> use a more unique name such as ndiv or mydiv.
> The system would not be confused trying to figure out what to do with it.


"div1" is not a valid tag name (element) and is every bit as unique as
"ndiv" or "mydiv". No css-capable browser that I know would be
confused by "div1"

> Why are wanting to color the bottom border of a paragraph?
> Just use <hr>.


IMO, Steven is attempting to go the right route, eliminating
non-essential content. If the underline is important enough though, he
might add an <hr> with { display: none } if he wishes to cater to
non-css browsers.

--
-bts
-This space intentionally left blank.
 
Reply With Quote
 
qx
Guest
Posts: n/a
 
      01-23-2004
Mark Parnell <(E-Mail Removed)> wrote:
> IE doesn't support the child selector, >


More specifically, IE for Windows doesn't. IE for Mac does,
along with other goodies like the adjacent selector and fixed
positioning.

 
Reply With Quote
 
steven
Guest
Posts: n/a
 
      01-23-2004
"Beauregard T. Shagnasty" <(E-Mail Removed)> wrote in message
news:4O1Qb.7008$(E-Mail Removed)...
> Quoth the raven named Richard:
>
> >
> > I would strongly suggest not using a tag name as a class/id name.
> > use a more unique name such as ndiv or mydiv.
> > The system would not be confused trying to figure out what to do with

it.
>
> "div1" is not a valid tag name (element) and is every bit as unique as
> "ndiv" or "mydiv". No css-capable browser that I know would be
> confused by "div1"


I guess Richard overlooked the '1'.


> > Why are wanting to color the bottom border of a paragraph?
> > Just use <hr>.

>
> IMO, Steven is attempting to go the right route, eliminating
> non-essential content.


Ah, finally somebody who can understand me.
And it also explains the idiotic div name. (FYI, the actual div name is
"mainmenu").
Thanx for the replies, everyone.

--
Steven



 
Reply With Quote
 
Kris
Guest
Posts: n/a
 
      01-23-2004
In article <7O4Qb.1255$(E-Mail Removed)-ops.be>,
"steven" <(E-Mail Removed)> wrote:

> > > Why are wanting to color the bottom border of a paragraph?
> > > Just use <hr>.

> >
> > IMO, Steven is attempting to go the right route, eliminating
> > non-essential content.

>
> Ah, finally somebody who can understand me.


The everlasting battle between those who understand the differences
between separating and encapsulating content, and those who don't.

--
Kris
<(E-Mail Removed)> (nl)
<http://www.cinnamon.nl/>
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      01-23-2004
"Richard" <anonymous@127.000> wrote:

> I would strongly suggest not using a tag name as a class/id name.


Why? It might not be optimally informative and mnemonic to a human
reader, but surely there's nothing technically wrong with using
<div class="div" id="div">.

And it could make perfect sense in some cases to use a tag name
(that is, a string that is also defined as a tag name, or element name
to be more exact). For example, if you, for some reason, wrap all your
body content into a div element, what would be more logical than assign
class "body" to it?
<body><div class="body">...</div></body>

> use a more unique name such as ndiv or mydiv.


That would hardly be any more understandable.

> The system would not be confused trying to figure out what to do
> with it.


Have you any actual evidence of a browser getting confused with the use
of a tag name as a class or id name? Please let us know, so that we can
avoid such horrendously buggy wowsers.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Class selector, ID selectors and link pseudo-classes Luigi Donatello Asero HTML 1 06-04-2005 06:58 PM
Class selector, ID selectors and link pseudo-classes Luigi Donatello Asero HTML 4 06-04-2005 05:02 PM
InputStream and Selector HK Java 5 04-23-2005 07:51 AM
Multi list box selector and post back question Brian Henry ASP .Net 3 08-18-2004 11:31 PM
selector.select() in NIO and high cpu usage Arandil Java 1 04-12-2004 02:04 PM



Advertisments