CSS is FAIL
Jan 16 2009, 5:30 am
By: Syphon  

Jan 16 2009, 5:30 am Syphon Post #1



So I'ma coding the new Blonde Foundation, and apparently, it decides not to recognise the first pseudo-class under a > selector...

That is,
Code
div#subnav > a:first-child:link, a:first-child:visited
{
    color: #d08257;
    text-decoration: none;
}


Doesn't apply the style to a:first-child:link. If I write it twice, it does, to the second one. Like so.

Code
div#subnav > a:first-child:link, a:first-child:link, a:first-child:visited
{
    color: #d08257;
    text-decoration: none;
}


Any pseudo classes I put under it do this, I haven't tried normal classes. Does anyone know why? Is it a Mozilla bug? A CSS bug?

EDIT- Tested in IE. Looks like a CSS bug?



None.

Jan 16 2009, 6:17 pm Kellimus Post #2



Quote from Syphon
So I'ma coding the new Blonde Foundation, and apparently, it decides not to recognise the first pseudo-class under a > selector...

That is,
Code
div#subnav > a:first-child:link, a:first-child:visited
{
    color: #d08257;
    text-decoration: none;
}


Doesn't apply the style to a:first-child:link. If I write it twice, it does, to the second one. Like so.

Code
div#subnav > a:first-child:link, a:first-child:link, a:first-child:visited
{
    color: #d08257;
    text-decoration: none;
}


Any pseudo classes I put under it do this, I haven't tried normal classes. Does anyone know why? Is it a Mozilla bug? A CSS bug?

EDIT- Tested in IE. Looks like a CSS bug?

CSS is Standardized.. IE is not..

Its not the CSS cause its been standardized by the W3C so I am blaming IE on this one cause they're not standardized.



None.

Jan 16 2009, 7:23 pm Forsaken Archer Post #3



I don't see anything wrong.
Test file: [attach=2588]

I believe you are making a syntax error for you to think it's a bug, as you are writing two very different declarations. You probably want this:
div#subnav > a:first-child:link, div#subnav > a:first-child:visited { }
in which case, you will either get your colors or you won't, depending on if your <a> element is truly the first element under the subnav div.
It's probably not though, because your other declarations are working which are an <a> element being the first element of any element.

HTML example?

Oh, and it won't work in IE, at least up until IE 7. I tried getting away using various css2 stuffs on sen before I finally gave up on IE complaints.

Edit: And as far as possible solutions:
If your <a> is is a consistent dom, just transverse it as needed. As if there was a <br /> between the subnav and <a>: div#subnav > br:first-child + a:link or if a is inside another element, div#subnav > *:first-child: > a:first-child:link.
Or if possible, make the link in an empty span/div with it's own name and start from there. <div subnav>blah blah blah <div links><a><a><a></div></div> and switch your subnav css to the new links class.

Also, I hope you realize there will only be one <a> element that would apply to the class you wrote, ever.

Attachments:
test.html
Hits: 3 Size: 0.52kb

Post has been edited 1 time(s), last time on Jan 16 2009, 7:38 pm by isolatedpurity.



None.

Jan 16 2009, 8:58 pm Kellimus Post #4



Quote from name:isolatedpurity
I don't see anything wrong.
Test file: [attach=2588]

I believe you are making a syntax error for you to think it's a bug, as you are writing two very different declarations. You probably want this:
div#subnav > a:first-child:link, div#subnav > a:first-child:visited { }
in which case, you will either get your colors or you won't, depending on if your <a> element is truly the first element under the subnav div.
It's probably not though, because your other declarations are working which are an <a> element being the first element of any element.

HTML example?

Oh, and it won't work in IE, at least up until IE 7. I tried getting away using various css2 stuffs on sen before I finally gave up on IE complaints.

Edit: And as far as possible solutions:
If your <a> is is a consistent dom, just transverse it as needed. As if there was a <br /> between the subnav and <a>: div#subnav > br:first-child + a:link or if a is inside another element, div#subnav > *:first-child: > a:first-child:link.
Or if possible, make the link in an empty span/div with it's own name and start from there. <div subnav>blah blah blah <div links><a><a><a></div></div> and switch your subnav css to the new links class.

Also, I hope you realize there will only be one <a> element that would apply to the class you wrote, ever.

Lol, the anchor tag just has different parameters (or do they call them attributes in HTML?) to it, lol.

Attachments:
test.html
Hits: 3 Size: 0.52kb



None.

Jan 17 2009, 12:47 am Syphon Post #5



Kellimus, if you'd bothered to read, you'd see I'd tested it in Firefox before IE. Also, the w3 CSS validator passes it.

IP, what you typed works exactly the same as the syntax I had... Although I cut it down, because I didn't really need the first-child pseudo. (Mainly, it's not a first-child any more.) now it's

Code
#subnav > a:link, a:link, a:visited
{
    color: #a37347;
    text-decoration: none;
}

#subnav > a:hover, a:hover, a:active
{
    color: #d08257;
    text-decoration: underline;
}


And this works perfectly, but the a:hover and a:link stop getting styled unless I have something before them. This is what is confusing me. It doesn't need to be repeated, it just needs any class before it. p, make it work, for example.

EDIT - For the record
Code
#subnav > a:link, #subnav > a:visited
{
    color: #a37347;
    text-decoration: none;
}

#subnav > a:hover, #subnav > a:active
{
    color: #d08257;
    text-decoration: underline;
}
doesn't work.

Post has been edited 1 time(s), last time on Jan 17 2009, 12:54 am by Syphon.



None.

Jan 17 2009, 12:53 am Syphon Post #6



The HTML it's on is
Code
<div id='subnav'>
        <span id='left'>
        //Title// <span style='font-weight: normal'>by</span> <a href='//authorprofile//'>//Author//</a>
        </span>
        <span id='right'>
        First | Last | Random | Next | Newest
        </span>
    </div>




None.

Jan 17 2009, 1:09 am Syphon Post #7



I'm retarded.

Code
#subnav a:link, #subnav a:visited
{
    color: #a37347;
    text-decoration: none;
}

#subnav a:hover, #subnav a:active
{
    color: #d08257;
    text-decoration: underline;
}


Done.



None.

Jan 17 2009, 1:18 am Forsaken Archer Post #8



I think you want:
#subnav a:link, #subnav a:visited { colors; }



None.

Jan 17 2009, 1:18 am Forsaken Archer Post #9



Fuck you beat me to it while I was testing it to make sure ;o



None.

Jan 17 2009, 1:19 am Syphon Post #10



See my previous post. :P



None.

Jan 17 2009, 1:19 am Syphon Post #11



Fuck you beat me to the ninja'd gloating!

So the moral of the story is, it was disregarding the first part, because it didn't mean anything, and I am horrible at CSS syntax :lol:



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:19 pm]
Vrael -- IM GONNA MANUFACTURE SOME SPORTBALL EQUIPMENT WHERE THE SUN DONT SHINE BOY
[01:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[2024-5-01. : 1:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
[2024-4-30. : 7:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
Please log in to shout.


Members Online: Roy