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.
[06:47 am]
NudeRaider -- lil-Inferno
lil-Inferno shouted: nah
strong
[05:41 am]
Ultraviolet -- 🤔 so inf is in you?
[04:57 am]
O)FaRTy1billion[MM] -- my name is mud
[04:35 am]
Ultraviolet -- mud, meet my friend, the stick
[10:07 pm]
lil-Inferno -- nah
[08:36 pm]
Ultraviolet -- Inf, we've got a job for you. ASUS has been very naughty and we need our lil guy to go do their mom's to teach them if they fuck around, they gon' find out
[05:25 pm]
NudeRaider -- there he is, right on time! Go UV! :D
[05:24 pm]
lil-Inferno -- poopoo
[05:14 pm]
UndeadStar -- I wonder if that's what happened to me. A returned product (screen) was "officially lost" for a while before being found and refunded. Maybe it would have remained "lost" if I didn't communicate?
[03:36 pm]
NudeRaider -- :lol:
Please log in to shout.


Members Online: IlyaSnopchenko, 1taylorc781eL2