Re: [jQuery] OT: CSS Conditional Comments

2007-01-25 Thread Klaus Hartl
Ⓙⓐⓚⓔ wrote:
> Micheal, so that only works with inline 

Re: [jQuery] OT: CSS Conditional Comments

2007-01-25 Thread Klaus Hartl
Olaf Bosch wrote:
> Aaron Heimlich schrieb:
> 
>> I don't recall whether IE Mac can read conditional comments, but it
>> shouldn't matter much considering it's pretty much dead and gone by now.
> 
> The IE Mac ignore CC's
> 

Yes, IE Mac is (was) a completely different browser (apart from the 
name). If you need to include an IE Mac specific style sheet use the 
IE5/Mac Band Pass Filter:

http://www.stopdesign.com/examples/ie5mac-bpf/

But honestly, IE 5 for Mac is considered a dead browser.


-- Klaus


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] OT: CSS Conditional Comments

2007-01-25 Thread Klaus Hartl
Ⓙⓐⓚⓔ wrote:
> sure looks right!  IE is disgusting, as so are conditional comments! I
> prefer to kludge IE all at once in an if ($.browser.msie) block , and
> even load in a different style sheet for those crazy browsers!  I read
> a way that IE naturally ignores some css (without conditional
> comments) that  a new compliant IE might obey! Perhaps an IE guru can
> shed more info here.

That is true to some extend. IE 6 does not support advanced CSS 2 
selectors. That means you can easily exclude rules from IE 6 by using these:

body>div {
 /* declarations not seen by IE 6 */
}

Note that you mustn't put white space into that selector like "body > 
div" as some IE 5 versions will interpret everything after the 
combinator ">", e.g. it would apply the declarations to all divs in this 
example.

This is what I call a bad hack, because it is not future proof. Such 
hacks have been used a lot, but obviously caused a lot of problems when 
IE 7 came out which supports these CSS 2 selectors and suddenly applied 
the styles meant to be excluded from it. *Don't do it!*

Conditional Comments may seem ugly but are the by far safest way to 
serve IE specific styles. The propability that Opera will implement CC 
and then let "if IE" evaluate to true goes against negative infinity.

I usually use one single IE style sheet included via CC and than hack a 
little bit in that one if I need to address IE 7 or 6 solely.

For IE 7 I can than use advanced CSS 2 selectors like the one above. For 
IE 6 you can use the underscore hack ("_height: 300px") or the Star 
Selector Hack, which is not understood by IE 7 running in Standards Mode.

For example to achieve automatic clearing I use:

.somethingWithFloatsInside {
 display: inline-block; /* @ IE 7 */
 _height: 1%; /* @ IE 6 */
}


-- Klaus




___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] OT: CSS Conditional Comments

2007-01-25 Thread Olaf Bosch
Aaron Heimlich schrieb:

> I don't recall whether IE Mac can read conditional comments, but it
> shouldn't matter much considering it's pretty much dead and gone by now.

The IE Mac ignore CC's

-- 
Viele Grüße, Olaf

---
[EMAIL PROTECTED]
http://olaf-bosch.de
www.akitafreund.de
---

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] OT: CSS Conditional Comments

2007-01-24 Thread Aaron Heimlich

On 1/25/07, Aaron Heimlich <[EMAIL PROTECTED]> wrote:


Actually, you can use conditional comments around any HTML (but only HTML)



That means that both of these are valid:


   #foo {
   /* do stuff for every browser...*/
   }







I don't recall whether IE Mac can read conditional comments, but it
shouldn't matter much considering it's pretty much dead and gone by now.

It's also a good idea to put conditional comments after your main styles (as
everyone's examples have done) so that the IE specific rules will properly
override the main ones.

--
Aaron Heimlich
Web Developer
[EMAIL PROTECTED]
http://aheimlich.freepgs.com
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] OT: CSS Conditional Comments

2007-01-24 Thread Aaron Heimlich

On 1/25/07, Ⓙⓐⓚⓔ <[EMAIL PROTECTED]> wrote:


So the sum total is to use conditional comments around the link to a
separate css for IE.



Actually, you can use conditional comments around any HTML (but only HTML)

--
Aaron Heimlich
Web Developer
[EMAIL PROTECTED]
http://aheimlich.freepgs.com
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] OT: CSS Conditional Comments

2007-01-24 Thread Sam Collett
On 25/01/07, Christopher Jordan <[EMAIL PROTECTED]> wrote:
> Sorry for the off-topic post, but I know that css tends to get discussed
> a lot around here, and I'm sure someone here will know what I'm doing wrong.
>
> Okay, so I've got a div that contains a single  tag. In FF 2.0.0.1
> this text is vertically centered inside the div. In IE 6, it is not. So,
> I can fix IE by including a line-height equal to the height of the
> parent div. Fine, but that screws up FF. It seems that conditional
> comments are the solution for me, but I think I'm not using them right,
> because they're not working.
>
> Here's my code:
>
>  snip from css 
> div.SiteHeader{
> border: 1px solid #336566; /*AA*/
> width: 850px;
> background-color: #E3F0D6; /*D5F0D5,CDD9E5*/
> height: 60px;
> text-align: left;
> margin: auto;
> 
> }
> p.SiteHeaderText{
> font-size: 20px;
> font-weight: bold;
> color: #3F6F5E; /*#698DB0 (light), #5880A7 (darker), #4F7396 (darker
> still), #466686 (darkest yet)*/
> padding-left: 5px;
> }
>
>  end snip 
>
>  the html 
> 
> Cottonwood Financial Web Administation
> 
>
> Am I not using the conditional comments correctly? This is my first
> attempt at ever using them.
>
> I should also mention I'm using the following DocType:
>
>  "http://www.w3.org/TR/html4/strict.dtd";>
>
> I'd appreciate any help.
>
> Thanks,
> Chris
>
>
> --
> http://cjordan.info

Create a new stylesheet containing your IE hacks (i.e. ie.css) and in
the head of your html page (if it is needed for IE7 as well, use


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] OT: CSS Conditional Comments

2007-01-24 Thread Ⓙⓐⓚⓔ
So the sum total is to use conditional comments around the link to a
separate css for IE. And possibly more than one for more problems with
each version.

Hopefully you're using some content management or server side includes
or the like to make it site wide.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] OT: CSS Conditional Comments

2007-01-24 Thread Michael Geary
> > 

Re: [jQuery] OT: CSS Conditional Comments

2007-01-24 Thread Blair McKenzie

You need to put your IE specific css in a separate css file and put the html
link to that file inside the conditional comments.

If you want to put IE specific css settings inside your css file, you can
use a hack (hack = not supported. MS has committed to supporting conditional
comments). One of those is the underscore hack: '_line-height: 60px;'. Other
browsers ignore this invalid property, but IE skips merrily over it and
parses line-height. NOTE: this IS a hack, which means that it could stop
working at some point. Conditional comments will always work.

Blair

On 1/25/07, Ⓙⓐⓚⓔ <[EMAIL PROTECTED]> wrote:


Micheal, so that only works with inline 

Re: [jQuery] OT: CSS Conditional Comments

2007-01-24 Thread Ⓙⓐⓚⓔ
I found this quote on the net... it may help

While still in main CSS file, hacked selectors start with * html. This
is known as the 'star-HTML' hack. Standard compliant browsers ignore
this selector, because there's actually no elements above html in a
document tree. Luckily, IE doesn't know that and we're safe to use
this flaw when applying IE specific hacks. Once we move hacks to a
separate file and call it in a document with conditional comments,
it's safe to remove the * html part.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] OT: CSS Conditional Comments

2007-01-24 Thread Karl Swedberg
That's right, and it often makes sense to put all of your IE-only  
styles in a separate stylesheet. So, in the HTML  you might  
have something like this:


  

  


cheers,
--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Jan 25, 2007, at 1:23 AM, Michael Geary wrote:


}



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] OT: CSS Conditional Comments

2007-01-24 Thread Ⓙⓐⓚⓔ
Micheal, so that only works with inline 

Re: [jQuery] OT: CSS Conditional Comments

2007-01-24 Thread Michael Geary

> }


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] OT: CSS Conditional Comments

2007-01-24 Thread Ⓙⓐⓚⓔ
sure looks right!  IE is disgusting, as so are conditional comments! I
prefer to kludge IE all at once in an if ($.browser.msie) block , and
even load in a different style sheet for those crazy browsers!  I read
a way that IE naturally ignores some css (without conditional
comments) that  a new compliant IE might obey! Perhaps an IE guru can
shed more info here.




> 

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/