SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Evangelist ktown's Avatar
    Join Date
    May 2001
    Location
    toronto
    Posts
    478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    trying to learn sibling selectors.

    hey all

    i'm trying to figure out how this sibling selector stuff works... sooo... why doesn't this code work? it makes no sence to me

    Code:
    <html>
    <head>
    	<STYLE TYPE="text/css">
    		H1 { font-size: xx-large }
    		H2 { font-size: x-large }
    		H1 + H2 { font-size: small }
    		P + P { text-indent: 2em }
    	</STYLE>	
    
    
    </head>
    
    <body>
    
    
    <H1>first title xx-large</H1>
    <P>This is  a P - he he he.. stupid P isn't cooperating</P>
    <p>This paragraph is the 2nd so it should theoretically indent 2em</p>
    <p>this stupid paragraph isn't indenting!!!</p>
    <H2>this is the second title x-large</H2>
    
    <P>trying the tags inside eachother</P>
    
    <H1>H1</H1>
    <H2>this isn't small like it should be :(</H2>
    
    
    </body>
    </html>
    please help.
    thanks
    ~nina

  2. #2
    morphine for a wooden leg randem's Avatar
    Join Date
    Jun 2002
    Location
    .chicago.il.us
    Posts
    957
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your code works fine for me in Mozilla/Netscape 7. However, it did not work in IE6.

  3. #3
    SitePoint Evangelist ktown's Avatar
    Join Date
    May 2001
    Location
    toronto
    Posts
    478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    okay... since it didn't work in IE i figured it wouldn't work anywhere else since its the most forgiving browser...

    it doesn't seem to work in EI and thats it (well NS 4.x too but nothing works there anyways) ... thats dumb... does anyone know why?

    thanks.

  4. #4
    morphine for a wooden leg randem's Avatar
    Join Date
    Jun 2002
    Location
    .chicago.il.us
    Posts
    957
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes. It's because Internet Explorer does not support that part of the CSS standard. In fact, you'll find that IE's standards support is actually pretty lousy.

    This is why Mozilla 1.0 is gaining so much popularity so fast.

  5. #5
    SitePoint Evangelist ktown's Avatar
    Join Date
    May 2001
    Location
    toronto
    Posts
    478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what is microsoft thinking?!?!? that has got to be one of the stupidest things i have ever heard

    thanks for the reply randem

    ~nina

  6. #6
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not seeing how this is particularly useful.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  7. #7
    SitePoint Evangelist ktown's Avatar
    Join Date
    May 2001
    Location
    toronto
    Posts
    478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i never said it was useful... i said i was trying to learn more css - it can't hurt knowing what "can" be done, right?

    ~nina

  8. #8
    morphine for a wooden leg randem's Avatar
    Join Date
    Jun 2002
    Location
    .chicago.il.us
    Posts
    957
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by creole
    I'm not seeing how this is particularly useful.
    Sibling selectors could be useful. I, for one, would like to be able to use sibling selector for a project I'm working on, but am unable to because of IE.

    What I wanted to do was create one style for H2 which renders the text, etc. And another style for H2+DIV.shadow which leaves a negative bottom-margin in the event that I want to underlay a drop-shadow. And so on... you get the idea.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •