Comments on: The :first-element selector crashes IE http://www.terminally-incoherent.com/blog/2008/06/16/the-first-element-selector-crashes-ie/ I will not fix your computer. Tue, 04 Aug 2020 22:34:33 +0000 hourly 1 https://wordpress.org/?v=4.7.26 By: Luke Maciak http://www.terminally-incoherent.com/blog/2008/06/16/the-first-element-selector-crashes-ie/#comment-9385 Tue, 17 Jun 2008 17:33:50 +0000 http://www.terminally-incoherent.com/blog/2008/06/16/the-first-element-selector-crashes-ie/#comment-9385

Ah, good point. I forgot you can do the negation there. :P

Knowing my luck IE8 will be able to handle the *| notation, but will still crash on :first-element. :(

Reply  |  Quote
]]>
By: STop http://www.terminally-incoherent.com/blog/2008/06/16/the-first-element-selector-crashes-ie/#comment-9384 Tue, 17 Jun 2008 16:58:54 +0000 http://www.terminally-incoherent.com/blog/2008/06/16/the-first-element-selector-crashes-ie/#comment-9384

Luke: I quite understand your concern about the maintainability issue.
Still, you could use the negative condition <!–[if !IE]>–> (“if NOT IE”) to make IE ignore any rules you wish… (which is sort of opposite of what other conditional comments do :-P).
The trouble with CSS hacks, is that they usually end up skrewing something up in the next IE-release.

Reply  |  Quote
]]>
By: Luke Maciak http://www.terminally-incoherent.com/blog/2008/06/16/the-first-element-selector-crashes-ie/#comment-9380 Tue, 17 Jun 2008 12:54:24 +0000 http://www.terminally-incoherent.com/blog/2008/06/16/the-first-element-selector-crashes-ie/#comment-9380

While the hacks vs conditional comments argument is indeed worth debating, I personally think this particular instance the hack is more valuable:

1. we want to apply a certain rule to everything but IE (sort of oposite of what conditional comments do)
2. if we use conditional comments, the rule will be applied, then overridden instead of just ignored
3. the IE specific style sheet will still be using the :first-element and will need to override the margin, padding, font size and other attributes
4. If you modify margin, padding and font size using the :first-element IE will crash – ego, IE specific stylesheet here is not the way to go

Also, I will argue that having the select few rules ignored is more maintainable than two separate style sheets since it keeps things in a single file.

Reply  |  Quote
]]>
By: STop http://www.terminally-incoherent.com/blog/2008/06/16/the-first-element-selector-crashes-ie/#comment-9379 Tue, 17 Jun 2008 11:53:03 +0000 http://www.terminally-incoherent.com/blog/2008/06/16/the-first-element-selector-crashes-ie/#comment-9379

These poor souls could run the portable version of Firefox from their USB-key, as I do right now!…

BTW: why use CSS hacks when you could use conditional comments? This method is IMHO more efficient for sorting out the different IE-versions, no? And it’s kinda more self-documenting.

Reply  |  Quote
]]>
By: Luke Maciak http://www.terminally-incoherent.com/blog/2008/06/16/the-first-element-selector-crashes-ie/#comment-9377 Tue, 17 Jun 2008 05:05:49 +0000 http://www.terminally-incoherent.com/blog/2008/06/16/the-first-element-selector-crashes-ie/#comment-9377

Yeah, but I kinda like to be accessible to folks with IE also – you know, for example the poor souls who are not allowed to install Firefox on their work computer.

Reply  |  Quote
]]>
By: Travis McCrea http://www.terminally-incoherent.com/blog/2008/06/16/the-first-element-selector-crashes-ie/#comment-9374 Tue, 17 Jun 2008 03:35:08 +0000 http://www.terminally-incoherent.com/blog/2008/06/16/the-first-element-selector-crashes-ie/#comment-9374

I don’t know if i posted this earlier or am just crazy (probably in your spam que I comment too much sorry):

When working on my personal site (a while ago it was the blog.gp one) I just turned off stylesheets for Internet Explorer and made a big banner saying “YOU ARE USING INTERNET EXPLORER, SINCE YOUR BROWSER SUCKS YOU CAN ONLY VIEW MY CONTENT WITHOUT FORMATTING, PLEASE UPGRADE TO FIREFOX, OPERA, or FLOCK TODAY”

:D it was great.

I think it would be cool to have a web wide “Block IE Day” where all the websites who take part would block IE from their site for a day and redirect to firefox.com (shoulda done it on download day.. and planned this more out). Or even just what I did, and have a “MOON IE DAY” where we show IE our Naked ‘s

Reply  |  Quote
]]>
By: Luke Maciak http://www.terminally-incoherent.com/blog/2008/06/16/the-first-element-selector-crashes-ie/#comment-9372 Tue, 17 Jun 2008 01:09:44 +0000 http://www.terminally-incoherent.com/blog/2008/06/16/the-first-element-selector-crashes-ie/#comment-9372

I could… But then I would have 2 style sheets to worry about. And two documents to fetch as the page is loading. It seems a bit cleaner this way.

Also, in this case I want IE to simply ignore this rule. If I created a second style sheet I would have to overwrite ALL the values I specified in that rule – meaning padding, margin, font size, color and etc… These are inherited from all over the place, and I’m not even sure what they should be. As you can see, the blockquotes in comments use a smaller font that the ones in the main body of the post.

Also, I would still be using the :first-element syntax in the IE stylesheet – which means it could still crash it. So I think the star-pipe hack is a better solution here.

Reply  |  Quote
]]>
By: Travis McCrea http://www.terminally-incoherent.com/blog/2008/06/16/the-first-element-selector-crashes-ie/#comment-9371 Tue, 17 Jun 2008 00:50:39 +0000 http://www.terminally-incoherent.com/blog/2008/06/16/the-first-element-selector-crashes-ie/#comment-9371

I was watching the live video on ustream all yesterday… its not “leaked” EA sent him a copy of it…

in widly unrelated news:
You know.. you COULD just create a second stylesheet and do the <!– if[IE] – stylesheet –>

Thing

Reply  |  Quote
]]>
By: Luke Maciak http://www.terminally-incoherent.com/blog/2008/06/16/the-first-element-selector-crashes-ie/#comment-9369 Mon, 16 Jun 2008 19:11:06 +0000 http://www.terminally-incoherent.com/blog/2008/06/16/the-first-element-selector-crashes-ie/#comment-9369

[quote post=”2522″]Hehe, I like the fact that, in the eyes of the almighty search engines, you’ve created a weak link between the phrase “Joel Spolsky is such a fucking tool” and his website.[/quote]

Actually, I linked to my own post. I guess I wasted a pretty good opportunity to googlebomb Joel there. :(

[quote post=”2522″]In widly unrelated news, the trial version of the Creature Creator from Spore got leaked onto the net a day early. No money to be saved since it’s just the trial, but it’s here now.. not tomorrow, now! … NOW![/quote]

LOL. So much for the draconian DRM they were planning to put on top of Spore. :P

Reply  |  Quote
]]>
By: Matt` http://www.terminally-incoherent.com/blog/2008/06/16/the-first-element-selector-crashes-ie/#comment-9368 Mon, 16 Jun 2008 18:50:02 +0000 http://www.terminally-incoherent.com/blog/2008/06/16/the-first-element-selector-crashes-ie/#comment-9368

Hehe, I like the fact that, in the eyes of the almighty search engines, you’ve created a weak link between the phrase “Joel Spolsky is such a fucking tool” and his website. :lol:

To be perfectly honest, no surprises here – some new random code snippet that IE chokes on… nothing new.

In widly unrelated news, the trial version of the Creature Creator from Spore got leaked onto the net a day early. No money to be saved since it’s just the trial, but it’s here now.. not tomorrow, now! … NOW! :mrgreen:

Reply  |  Quote
]]>