Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE 7 (Vista beta) question

Status
Not open for further replies.

BabyJeffy

Programmer
Sep 10, 2003
4,189
GB

I was thinking about the "child selector hack" that is popular with many sites (including some of the very high profile sites on the internet). The hack is very simple... it's totally valid CSS that the whole IE family just doesn't understand - and so you can effectively set a style for "all browsers that aren't IE".

Example:
Code:
p {color:red;}
html>body p {color:green;}
Paragraph text will appear in red for all versions of IE, but in green for everything else.

So what happens with IE7 beta? If it is becoming more standards compliant, then they really have to support the child selector. If they do that... the hack is going to break (although it will still work fine for pre-version 7 IE family).

Could someone with IE7 beta try the code I have shown above and reply back with the result?

Cheers,
Jeff
 
However, if IE7 will be standards compliant, you might not need apply the hack for it. I like some of the hacks that work in IE pre 6 and don't for IE6, because IE6 has a better standards compliance. I guess you should take that into account as well.
 
So what happens with IE7 beta?
Who cares? it's a beta. If you want to surf with a half-finished product, that's your look-out. I'm not going to lose any sleep over supporting beta products.

If you're concerned about the production version of IE7 when it comes out, that's a different matter. It's going to have, we're told, much better CSS support - so if your use of the child selector hack is to hide all sorts of stuff that previous versions of IE didn't understand, it won't be needed.

If you just want to use a different colour for users of any flavour of IE, you can use conditional comments to target particular style(sheet)s at them. Or wait till somebody figures out a CSS hack to direct CSS rules at IE7 only.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Who cares?
Um, I think that's rather obvious given I posted the question. But maybe you missed it. I care. I would like to know.

Why? I am currently working on a large high profile site. I am one of many developers working on this project. I have noticed a LOT of "Child-Selector" hacks sprinkled throughout the CSS that is being developed for this global rebrand. In every case (that I have dealt with on this code-base) these hacks are redundant (with a little extra CSS work)... but if left in they may very well cause problems.

I was hoping to hear "the hack does NOT work on the beta" so that I could take it to the team and put in place a strategy to remove all such hacks "and do it properly".

My first attempt to bring this to their attention fell on deaf ears. As I am sure those of you in the contract development business know, the "powers that be" are invariably unwilling to "change something that works" unless you have a very good case.

So, Chris... does that answer your question about why I want to know? Maybe you missed your caffiene this morning... but your last post just riled me up the wrong way.

Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]
 
Chris,

It's also worth pointing out that a Beta is usually considered to be very close to the functionality of the final product and as such is considered by many to be an early opportunity to discover how the final production version (as you call it) will function.

It is, therefore, not inappropriate to ask if someone has tested it in this scenario.


Trojan.
 
You kind of already answered this but

take it to the team and put in place a strategy to remove all such hacks "and do it properly".

I'd go with that mate.
Express your concerns and the fact that by "doing it right" they are covering their asses for future browsers.

No point in doing something wrong to start with really. Especially if it can be done a "right" way.

Foamcow Heavy Industries - Web design and ranting
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
I wonder what possesses people to make those animated gifs. Do you just get up in the morning and think, "You know what web design r
 
It's also worth pointing out that a Beta is usually considered to be very close to the functionality of the final product
Usually, perhaps, but not apparently at Microsoft - at least in the case of IE7. The current beta version may be close to the look and feel of the final interface, but judging by the comments on the IE developers' blog they intend to a add a lot more features and bug-fixes in areas like CSS support.

That's why I'm not losing any sleep over the IE7 beta, and I recommend you don't either. Its a beta. Unfinished, unreleased, likely to fall over in a heap - that's what theyre like. Heck, we spend enough time working around bugs in MS's finished products without worrying about their unfinished ones! FWIW, my understanding is that the current beta has much the same (lack of) CSS feature support as IE6, so if your site looks OK in IE6, it'll probably look the same in IE7beta.

Now, if you're worried about how your site will look in the full, released version of IE7 whenever it comes out, that's a whole different kettle of fish (though it's not the question you asked). Apparently it will fully support CSS2 selectors, so you're right - you won't be able to use the child selector to pick out only non-IE browsers. But the question is, why are you trying to identify browsers at all? Here are some possible scenarios...
[ol]
[li]The rule contains something that IE5-6 can't cope with, modern browsers can, and IE7 can handle too. E.g. PNG transparency - You can carry on using child selectors as before, since IE7 can understand the "non-IE" rules
[/li]
[li]The rule contains something that IE7 still can't handle - You're gonna have to find another way around this one (see below), but we can't know how much might fall into this category until the final product (or something very close to it) is released.
[/li]
[li]You just want to send something to (or hide something from) IE for some other reason, regardless of the version. Eg. a "Get Firefox" ad :). This is probably the least likely case, and can be dealt with as the previous one.[/li]
[/ol]
So how will we pick out IE7? Two possibilities - either use a new hack in your CSS (no doubt somebody will find one once they've got a final version to play with), or use IE's conditional comments feature to target a stylesheet specifically at IE. I'd probably do the latter, at least in type (3) cases. You could also use some server-side browser sniffing if you were desperate.

How to manage multiple CSS hacks for multiple browsers across your stylesheets? Take a look at this article: . I've not implemented it on my own (fairly simple) sites, but it seems like good advice on larger projects.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top