Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-03-06 04:57:09

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

conditional comments to exclude ie?

I am aware of the traditional methods of using conditional comments in the <head> in order to offer fixes to your default.css, by placing your ie.css in a conditional after your default, you can overwrite style rules.

However, is there a way to simply hand one stylesheet to all browsers other than ie and another to ie? Hiding the default.css from ie all together?

Last edited by ma_smith (2007-03-06 09:12:33)


Offline

#2 2007-03-06 09:22:34

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: conditional comments to exclude ie?


Offline

#3 2007-03-06 09:34:23

warmrobot
Member
From: Moscow, Russia
Registered: 2007-01-22
Posts: 31
Website

Re: conditional comments to exclude ie?

I Don’t think that it is good idea to operate with content accordingly browser name and version. Two stylesheets (one for normal browsers, and one for crapy browser ;) ) is more correct for me.

Offline

#4 2007-03-06 13:10:49

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: conditional comments to exclude ie?

warmrobot,
depends on your perspective.
we drive cars that make our driving experience more enjoyable, full… why not browsers? Every other piece of technology does it? (consider reading Transcending CSS) – I’ve been greatly influenced by it).

:)

Matthew


Offline

#5 2007-03-06 14:25:05

warmrobot
Member
From: Moscow, Russia
Registered: 2007-01-22
Posts: 31
Website

Re: conditional comments to exclude ie?

I agreed in this case with old good “Designing with web-standards” which says that as soon as we start substitute content for different browsers, we returned to “browser wars” times.

IE6 is not forever (IE7 I hope too). So, why we need to disfigure our beautiful HTML pages in favour of one (mainly) ugly browser. Let’s make this bad browser to eat snicky CSS stylesheet and forget about it. This is my position.

I did not read this book. It has not published in Russia yet. However, I khow about Andy Clarke. His “specifity wars” post, and choosing color for web technique are so great! I had chose color for my site as Andy says. :-)

I think Roger Johansson must write a book too.

Offline

#6 2007-03-06 15:55:31

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: conditional comments to exclude ie?

Are you serving up a whole different look to IE? IF not that seems like a whole lot of extra work.

Plus IE7 is pretty well behaved.


Shoving is the answer – pusher robot

Offline

#7 2007-03-06 16:31:35

warmrobot
Member
From: Moscow, Russia
Registered: 2007-01-22
Posts: 31
Website

Re: conditional comments to exclude ie?

Hmm… a afraid I misunderstood something. What you mean “whole different look”? Different from what?

Offline

#8 2007-03-06 17:18:23

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: conditional comments to exclude ie?

>Matthew, You could use…

Downlevel-revealed Conditional Comments

The downlevel-revealed conditional comment enables you to include content in downlevel browsers. The conditional expression controls whether Internet Explorer 5 and later download and render the content. The downlevel-revealed conditional comment is the complement of the downlevel-hidden conditional comment.

The following snippet shows a typical downlevel-revealed conditional comment.

<![if !IE]>
<p>This paragraph is ignored by all versions of IE, and should display in all other "downlevel" (what MS calls other agents) browsers</p>
<![endif]>

Offline

#9 2007-03-06 20:58:43

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: conditional comments to exclude ie?

I have taken the approach that I will write my css with standard modern browsers in mind, and I will pay NO attention to browsers that are not up to snuff.

Then… I will style my content differently, with equal viability, readability, usability, but with less finesse, and power, for those browsers which are not up to snuff.

This is not an issue of browser wars. We are moving in a common direction with standardization. We have a theme (the w3c), and so any browser which chooses to remain behind is doing so of their own accord. Anyone who chooses to use a browser like this is making a consciencious decision to use that browser or to not care about the technical life as some will not care to drive a superior vehichle.

I myself would drive a BMW if I could afford one, I cannot…but thankfully in terms of browsers I can drive the BMW of Safari or Firefox or Opera or Camino, etc etc, and I will share the advantages that option with other internet users (especially considering the “free” nature of these browsers).

That’s my take on it.

I was specifically looking for a way to offer a similar but different look to ie browsers, and did not wish to work to hack up a style sheet with selectors of stronger weight to override the default styles. This is not a site where it is imperitive for all viewers to have the same experience. Those sites exist, and I can code for those sites. This is an experiment in a different way of thinking. I am testing myself, and the theories of Andy Clarke (not that he has a monopoly on these theories), but his books was very influential in my decision :)

Matthew


Offline

#10 2007-03-06 21:05:50

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: conditional comments to exclude ie?

ps. Dale,
Good call.

Here’s a post that offers a “valid” version as well. I think this may do the trick.


Offline

#11 2007-03-06 21:24:13

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: conditional comments to exclude ie?

Sort of related – here’s what I do on my site:

<!--[if IE]><p id="firefox"><a href="http://getfirefox.com/" title="Friends don't let friends use Internet Explorer">Get A Better Browser</a></p><![endif]-->

Offline

#12 2007-03-06 22:18:28

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: conditional comments to exclude ie?

BTW Andy Clarke’s Site does what I meant by a whole different look. You get a Mod theme for everything and a Ska theme for IE6 and under. It’s neat.

This seems to be what Matthew is after.


Shoving is the answer – pusher robot

Offline

Board footer

Powered by FluxBB