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.
[04:56 am]
Ultraviolet -- I suppose we'll likely never know, but my guess would be that they already saw it operating successfully and there was no monetary incentive to finish the original work. And the dev cycle in old school Blizzard was so hectic, it's possible it just got forgotten about after the original game got released. Plus there's an element of existing MPQ files that were packaged with the original discs becoming outdated if they updated it. And it's not like they remade the original MPQs, they just made new ones for BW specifically
[04:26 am]
Oh_Man -- so that makes me think maybe the theory they are unfinished is not true and its a deliberate design decision, coz why not finish them wen ur making brood war?
[04:25 am]
Oh_Man -- the thing is thos buildings are from classic. that means they went ahead and made brood war without ever finishing the 'unfinished' buildings
[06:15 pm]
Ultraviolet -- Yeah he's talked about a lot of that stuff in his casts before. It seems plausible. Especially knowing how Blizzard of yesteryear operated.
[03:47 pm]
NudeRaider -- to clarify: couldn't recall the behavior for every single Protoss building but I was aware the disparity exists.
[03:43 pm]
NudeRaider -- Contained nothing new for me. Didn't know all building's behavior, but very much all unit's. Also Terran balance whine - also nothing new :lol:
[2026-6-19. : 9:57 am]
Oh_Man -- makes me wonder if SEN knows anything about the topic
[2026-6-19. : 9:57 am]
Oh_Man -- artosis dropped pretty interesting vid: https://youtu.be/EqZHB8Blra4
[2026-6-18. : 5:01 pm]
Ultraviolet -- :wob:
[2026-6-17. : 6:15 am]
RexyRex -- :wob:
Please log in to shout.


Members Online: Moose