A whole stylesheet just for IE

D

dorayme

Anybody here actually use a css sheet just for IE? I have been
thinking of it considering the hacks I have been lately putting
in to get IE to do more of what I want. Thought to just name it
ie.css, list it as the last of a bunch of css links in the head
and enclose the whole text of this last sheet in

/* Hides from IE5-mac \*/

and

/* End hide from IE5-mac */

and start all the css inside with

* html

Anyway, I read at

http://www.satzansatz.de/cssd/onhavinglayout.html

"The use of an external style sheet for whatever fixes IE-Win
needs, linked from inside a conditional comment, is also a secure
and elegant solution:

<link rel="stylesheet" href="allbrowsers.css" type="text/css" />

and then

<!--[if lte IE 6]>

<link rel="stylesheet" href="iefix.css" type="text/css" />

<![endif]-->"

Which is a thought? This means one could then simply have an
alternative normal stylesheet, no star hacks, no inner
conditionals etc... that only IE 6 sees, I presume? It is taken
as gospel by IE because it is the last sheet in the list in the
head?
 
A

Adrienne Boswell

Gazing into my crystal ball I observed dorayme
Anybody here actually use a css sheet just for IE? I have been
thinking of it considering the hacks I have been lately putting
in to get IE to do more of what I want. Thought to just name it
ie.css, list it as the last of a bunch of css links in the head
and enclose the whole text of this last sheet in

I use two sheets, one for positioning and one for colors.

I try very hard to not have to accomodate IE, but sometimes, because
that's what the boss uses, I have to. I was quite happy to put a few
hacks in for IE, and commented them for future reference.

Good thing I did that. About a week ago, the boss installed IE7, so the
nice hacks were not applicable. So far, they haven't thrown any real
bugs/errors. Of course, IE7 has its own little problems.

But, who knows, when IE7 goes out of beta, perhaps those nice little
hacks won't be ignored and do something nasty.

This is getting ridiculous - it reminds me of the old days when people
where writing for Netscape 4.

My advice to you is to comment the file well. That way you won't have
too many surprises.
 
M

Michael Winter

dorayme wrote:

[snip]
<!--[if lte IE 6]>

<link rel="stylesheet" href="iefix.css" type="text/css" />

<![endif]-->"

Which is a thought? This means one could then simply have an
alternative normal stylesheet, no star hacks, no inner
conditionals etc... that only IE 6 sees, I presume?

With the posted conditional comment, IE 5, 5.5, and 6 would use that
style sheet. IE 4 wouldn't, and I'm pretty sure that conditional
comments aren't supported by IE/Mac (I can't test the latter).

[snip]

Mike
 
D

dorayme

Michael Winter said:
dorayme wrote:

[snip]
<!--[if lte IE 6]>

<link rel="stylesheet" href="iefix.css" type="text/css" />

<![endif]-->"

Which is a thought? This means one could then simply have an
alternative normal stylesheet, no star hacks, no inner
conditionals etc... that only IE 6 sees, I presume?

With the posted conditional comment, IE 5, 5.5, and 6 would use that
style sheet. IE 4 wouldn't, and I'm pretty sure that conditional
comments aren't supported by IE/Mac (I can't test the latter).

I will give it a go then... and worry about it if IE Mac suffers
from it (which I can test... there are not many using that
browser now... I keep it for sentimental reasons mainly, it
served me well for years before I made websites.)
 
D

dorayme

Adrienne Boswell said:
This is getting ridiculous - it reminds me of the old days when people
where writing for Netscape 4.
It sure is!
My advice to you is to comment the file well. That way you won't have
too many surprises.

You are right, I tend not to because I don't trust myself not to
use the foulest language in the comments...
 
N

Nikita the Spider

dorayme said:
Anybody here actually use a css sheet just for IE?

Yes
<link rel="stylesheet" href="allbrowsers.css" type="text/css" />

and then

<!--[if lte IE 6]>

<link rel="stylesheet" href="iefix.css" type="text/css" />

<![endif]-->"

Which is a thought? This means one could then simply have an
alternative normal stylesheet, no star hacks, no inner
conditionals etc... that only IE 6 sees, I presume? It is taken
as gospel by IE because it is the last sheet in the list in the
head?

IE less than or equal to 6. I'm not sure what your comment about "taken
as gospel" means, but I think the answer is "no" anyway. =) I think IE
sees this additional stylesheet, other browsers do not. That's all there
is to it.

I usually write a single, normal stylesheet that works for the decent
browsers (Firefox, Operea, Safari, etc.) and then make an IE-specific
stylesheet that uses "! important" to override stuff in the normal
stylesheet that gives IE trouble.

HTH
 
D

dorayme

<[email protected]
t.rr.com>,
Nikita the Spider said:
dorayme said:
Anybody here actually use a css sheet just for IE?
Yes

<link rel="stylesheet" href="allbrowsers.css" type="text/css" />

and then

<!--[if lte IE 6]>

<link rel="stylesheet" href="iefix.css" type="text/css" />

<![endif]-->"

Which is a thought? This means one could then simply have an
alternative normal stylesheet, no star hacks, no inner
conditionals etc... that only IE 6 sees, I presume? It is taken
as gospel by IE because it is the last sheet in the list in the
head?

IE less than or equal to 6. I'm not sure what your comment about "taken
as gospel" means, but I think the answer is "no" anyway. =) I think IE
sees this additional stylesheet, other browsers do not. That's all there
is to it.

From the sound of what you are saying, you guess wrong, it _is_
taking it as gospel. :)

I just meant that IE will not only read it but use the
instructions in preference to others that can be seen by most
other browsers. If the css sheet is placed last in the header
list. If the IE sheet was not there, it would take as gospel what
is there. If the IE sheet was placed first in the list and there
were conflicting instructions in the "normal" later listed
sheets, it would take as gospel the later sheets... Right?

Taking as gospel means taking it to heart, not just reading and
noting... going forth with the blinding light of Higher Truth and
acting with mercy and justness in the world... Christ mate, don't
get me going!
I usually write a single, normal stylesheet that works for the decent
browsers (Firefox, Operea, Safari, etc.) and then make an IE-specific
stylesheet that uses "! important" to override stuff in the normal
stylesheet that gives IE trouble.

Thanks for this, so you are saying you use the conditional
construction I mention and it all works fine. That is good enough
for me. I trust you.
 
A

Adrienne Boswell

dorayme wote:
It sure is!


You are right, I tend not to because I don't trust myself not to
use the foulest language in the comments...

I've been away from my current project for three years, and the other
day, I was doing some debugging, hit Refresh, and the script put out
"Bend over and kiss your ass goodbye". It was part of some commenting
I made three years ago, and it had me howling with laughter.

Of course, now that I'm a Mom and I can't use fowl language anymore, I
make cleaner comments.
 
B

Beauregard T. Shagnasty

Adrienne said:
Of course, now that I'm a Mom and I can't use fowl language anymore, I
make cleaner comments.

What? You can't talk about chickens around your kids?
 
A

Adrienne Boswell

Beauregard T. Shagnasty wote:
What? You can't talk about chickens around your kids?

I made a very bad mistake. I told Spane that food that fell on the
floor was for the birds, not him. That worked for quite some time,
until he decided to throw food on the floor FOR the birds, whether a
bird is there or not. He says "food bird" and laughs - so no, I don't
talk about fowl around my son anymore (and if I didn't have this awful
cold I would have spelled the word correctly in the first place).
Well, I guess it's better than what I did when my mother told me kids
in Fill In Country were starving - I saved up the food in a box, and
gave the smelly package to my mother so she could mail it off.
 
B

Beauregard T. Shagnasty

Adrienne said:
Beauregard T. Shagnasty wote:

I made a very bad mistake. I told Spane that food that fell on the
floor was for the birds, not him. That worked for quite some time,
until he decided to throw food on the floor FOR the birds, whether a
bird is there or not. He says "food bird" and laughs - so no, I
don't talk about fowl around my son anymore (and if I didn't have
this awful cold I would have spelled the word correctly in the first
place). Well, I guess it's better than what I did when my mother told
me kids in Fill In Country were starving - I saved up the food in a
box, and gave the smelly package to my mother so she could mail it
off.

Ah, the things kids do.

My wife tells a story from her childhood. She didn't like mashed
potatoes and peas, especially peas. During the meal she would reach
under the table and stick mounds of potatoes and peas to the underside
of the table.

Months later, her mother rearranged the seating, and after a couple of
days her little brother managed to kick the table, and a glob of old
potatoes and peas fell to the floor. Her mother looked under there to
find a veritable upside-down *mountain range* of dried food.

Little brother got the blame. :)
 
D

dorayme

"Adrienne Boswell said:
I've been away from my current project for three years, and the other
day, I was doing some debugging, hit Refresh, and the script put out
"Bend over and kiss your ass goodbye". It was part of some commenting
I made three years ago, and it had me howling with laughter.

Of course, now that I'm a Mom and I can't use fowl language anymore, I
make cleaner comments.

<g>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top