Re: [css-d] How do you feed IE versions different css than w3c compliant browsers?

2008-04-16 Thread Michael Adams
On Wed, 16 Apr 2008 00:27:20 +0200
Manfred Staudinger wrote:

 On 15/04/2008, Bill Brown [EMAIL PROTECTED] wrote:
   You can use this syntax to target all NON-MSIE browsers:
   !--[if !IE] --
   style type=text/css@import url(css/fix/non_msie.css);/style
   !-- ![endif]--
 
 Thats definitely an unnecessary hack. The correct (although
 proprietary) syntax would be:
 !--[if IE]![if !IE]![endif]--
 style type=text/css
 css here
 /style
 !--[if IE]![endif]![endif]--
 

I find these both particularly ugly and use the '@import hack' instead.
Just a normal line in the HTML and the real hack in the CSS code itself.
After all it is the presentation, design or functionality that is the
issue, *not the content*.

This is all i have in the (X)HTML
 link rel=stylesheet href=master.css type=text/css /

But heres the CSS master file
/* ** master.css ** */

@import url(layout.css);
@import url(colour.css);
@import url(fonts.css);
@import url(.css) all; 

/*  */

That's it; the trick is in that final line. IE loads a file called
url(.css) all and all other browsers load a file called .css. It
relies on a bug in IE. I usually have very few hacks in the .css file
compared to the url(.css) all file.

I first read about this hack here:
http://annevankesteren.nl/2005/10/ie-import-hack

A full range of @import hacks and browsers affected are here:
http://imfo.ru/csstest/css_hacks/import.php
But my requirements are not that specific.

-- 
Michael

All shall be well, and all shall be well, and all manner of things shall
be well

 - Julian of Norwich 1342 - 1416
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


[css-d] How do you feed IE versions different css than w3c compliant browsers?

2008-04-15 Thread John Griessen
David Laakso wrote:

 You have height:1%; on the below selector.  You may (?) want to feed 
 that only to IE/6, as compliant browsers might do better without it at 
 +2 font-scaling.
 .p5 {
 height: 1%;
 }

I have a restructuredtext generated site that now looks as intended in firefox, 
but not in the IE
that is installed with Win2K.  IE seems to ignore the css positioning of a list 
and an image hyperlink.

http://ecosensory.com/

John Griessen
-- 
Ecosensory   Austin TX
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] How do you feed IE versions different css than w3c compliant browsers?

2008-04-15 Thread Bill Brown
 I have a restructuredtext generated site that now looks as intended in 
 firefox, but not in the IE
 that is installed with Win2K.  IE seems to ignore the css positioning of a 
 list and an image hyperlink.
 
 http://ecosensory.com/

Hi John,

You can use this syntax to target all NON-MSIE browsers:
!--[if !IE] --
style type=text/css@import url(css/fix/non_msie.css);/style
!-- ![endif]--

Use this syntax to target ALL MSIE browsers:
!--[if IE]
style type=text/css@import url(css/fix/all_msie.css);/style
![endif]--

And this will target specific versions of MSIE browsers:
!--[if IE 6]
style type=text/css@import url(css/fix/msie_6_0.css);/style
![endif]--
!--[if IE 7]
style type=text/css@import url(css/fix/msie_7_0.css);/style
![endif]--

CSS in the last three will not be seen by the validator, the first one 
will (the non-msie syntax). This is important if you care about validation.

Additionally, this sort of technique has advocates and opponents. It 
uses two semi-frowned-upon approaches:
   1. Proprietary syntax.
   2. Browser sniffing.

I use it because it also one of the most failsafe methods for targeting 
the two type of browsers: Nice, standards-compliant, user and developer 
friendly browsers...and anything made my Microsoft.

Hope it helps.
--Bill Brown
TheHolierGrail.com
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] How do you feed IE versions different css than w3c compliant browsers?

2008-04-15 Thread Manfred Staudinger
On 15/04/2008, John Griessen [EMAIL PROTECTED] wrote:
 Manfred Staudinger wrote:

  Hi John,
 
  If you want to select IE6 and IE7, but not IE8 nor IE5.5 or IE5.01
  then you might use
 
  !--[if lte IE 7]![if gte IE 6]
  style type=text/css
  css here
  /style
  ![endif]![endif]--
 
 

  Thanks,

  very helpful.  Looks like you just put this in line with your stds
 compliant css
  and the  css here lines are fed to the version of IE you selected, right?
Yes.

Manfred
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] How do you feed IE versions different css than w3c compliant browsers?

2008-04-15 Thread Manfred Staudinger
On 15/04/2008, Bill Brown [EMAIL PROTECTED] wrote:
  You can use this syntax to target all NON-MSIE browsers:
  !--[if !IE] --
  style type=text/css@import url(css/fix/non_msie.css);/style
  !-- ![endif]--

Thats definitely an unnecessary hack. The correct (although
proprietary) syntax would be:
!--[if IE]![if !IE]![endif]--
style type=text/css
css here
/style
!--[if IE]![endif]![endif]--

Regards,

Manfred
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] How do you feed IE versions different css than w3c compliant browsers?

2008-04-15 Thread Thierry Koblentz
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 discuss.org] On Behalf Of Bill Brown
 Sent: Tuesday, April 15, 2008 4:27 PM
 To: Manfred Staudinger
 Cc: css-d@lists.css-discuss.org; John Griessen
 Subject: Re: [css-d] How do you feed IE versions different css than w3c
 compliant browsers?
 
 Manfred Staudinger wrote:
  On 15/04/2008, Bill Brown [EMAIL PROTECTED] wrote:
   You can use this syntax to target all NON-MSIE browsers:
   !--[if !IE] --
   style type=text/css@import url(css/fix/non_msie.css);/style
   !-- ![endif]--
 
  Thats definitely an unnecessary hack. The correct (although
  proprietary) syntax would be:
  !--[if IE]![if !IE]![endif]--
  style type=text/css
  css here
  /style
  !--[if IE]![endif]![endif]--
  Regards,
  Manfred
 
 Manfred,
 
 I could not more *strongly* disagree with you, and I'm not sure why you
 are calling my syntax incorrect or unnecessary either. If they both
 do the same thing, mine not only appears (to me, at least) to be more
 elegant, but is shorter and more understandable. By comparison:
 
 Mine:
 !--[if !IE] --
 ... anything at all, including css here
 !-- ![endif]--
 
 and yours:
 
 !--[if IE]![if !IE]![endif]--
 ... anything at all, including css here
 !--[if IE]![endif]![endif]--

What about a simple:

!--[if !IE]
... anything at all, including css here
![endif]--

 Or am I totally missing something here?

Could be me ;)


-- 
Regards,
Thierry | http://www.TJKDesign.com




__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] How do you feed IE versions different css than w3c compliant browsers?

2008-04-15 Thread Nicholas Wilson
On Wednesday 16 April 2008 12:58 am Thierry Koblentz wrote:

 What about a simple:

 !--[if !IE]
 ... anything at all, including css here
 ![endif]--

  Or am I totally missing something here?

 Could be me ;)

But then every browser would ignore it, which is presumably not what you want.

Nicholas
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] How do you feed IE versions different css than w3c compliant browsers?

2008-04-15 Thread Nicholas Wilson
On Wednesday 16 April 2008 1:09 am John Griessen wrote:
 Thierry Koblentz wrote:
  What about a simple:
 
  !--[if !IE]
  ... anything at all, including css here
  ![endif]--

 This short one looks good...  As I understand this, it goes in default.css,
 so what else besides css code would you want to put here?

 John Griessen
 css newbie building his own selling web site.

!-- -- style comments go in the HTML file, not the css file.  You can put a 
link rel=stylesheet ... (/) in there if you need, but only IE supports 
these type of conditional comments, so you need to use [if IE].  Here is how 
you would build up the logic of the expression:

We have to start with:

!--[if IE]

Now IE thinks we are not in a comment, and the rest do.

!--[if IE]!--

Now IE has started a comment, and ! is ignored by the rest, so they now think 
they are not in a comment.

You mirror this with the closing tag:

!--[if IE]!--
...seen by everything except IE...
!--![endif]--

Nicholas
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] How do you feed IE versions different css than w3c compliant browsers?

2008-04-15 Thread David Laakso

1/
Regarding Conditional Comments, see: Microsoft Developer Network
http://msdn2.microsoft.com/en-us/library/ms537512(VS.85).aspx
2/
Regarding using Conditional Comments to feed hacks to IE, see:
On havingLayout (scroll down a little to: Alternatively, and possibly 
more future proof, are conditional comments:)
http://www.satzansatz.de/cssd/onhavinglayout.html#hacks

__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/