Re: Should we change linking so that conditional comments for IE are not destroyed?
by hostyle (Scribe) on Nov 05, 2004 at 18:25 UTC
|
While conditional comments can be handy when you're really really stuck, I don't like to rely on them - mostly because CSS best feature is seperating style from content, and conditional comments must be in the HTML. You can change the entire appearance of a site by editting one CSS file - but if you're using conditional CSS you may have to edit many HTML files. There are other methods of limiting CSS to IE.
/* display for IE only */
* html .whatever {
font-weight: 300;
/* hide from IE mac \*/
color: #ff0000;
/* */
}
Most CSS problems between IE 5, 5.5 and 6 on windows are easily resolved. If you have a particular problem that needs solving, let me know
-- update: to answer demerph --
See 398203
| [reply] [Watch: Dir/Any] [d/l] |
|
p.nnt-p-title { width: 70%; }
p.nnt-author { width: 28%; }
This CSS exploits a bug in IE which makes the Recently Active Threads look a lot nicer (IMO). But instead of ignoring it Opera will do totally silly things (as Opera users view the site in quirks mode)
| [reply] [Watch: Dir/Any] [d/l] |
Re: Should we change linking so that conditional comments for IE are not destroyed? (planned)
by tye (Sage) on Nov 05, 2004 at 20:03 UTC
|
It is on my list to not modify square brackets inside of HTML comments. There are several reasons to do this (allowing JavaScript in the Free Nodelet, for example). It will be done by parsing HTML and square brackets in a single pass.
| [reply] [Watch: Dir/Any] |
|
| [reply] [Watch: Dir/Any] |
Re: Should we change linking so that conditional comments for IE are not destroyed?
by Joost (Canon) on Nov 05, 2004 at 20:19 UTC
|
No.
Please don't use ugly hacks like this. There is no telling which other browsers parse HTML comments incorrectly, also rendering the "IE specific" code. IMHO it is not all that difficult to get IE 5 and higher to work well enough with anything that standards compliant browsers work with.
If you have any issues with IE, I'd be willing to take a stab at them. Send me a chatterbox msg if you want.
| [reply] [Watch: Dir/Any] |
Re: Should we change linking so that conditional comments for IE are not destroyed?
by Zero_Flop (Pilgrim) on Nov 05, 2004 at 20:31 UTC
|
<!--[if IE 5]>
<p> If you can read this, proceed to http://www.mozilla.org/products/f
+irefox/ and dl Firefox</p>
<![endif]-->
;)
ZF
By the way, I posted this from work and the text did not show up until I put it in code tags. IE6 ;( work imposed
| [reply] [Watch: Dir/Any] [d/l] |
|
<p style="display: none">
<font color="red" size="+4">You should be using a browser that support
+s CSS!</font><br>
<a href="http://mozilla.org">Upgrade now.</a>
</p>
;-)
| [reply] [Watch: Dir/Any] [d/l] |
|
Mozilla isn't an *upgrade* if you're using a different browser. I absolutely HATE the term "upgrade" where used instead of "migrate". For the record, Mozilla does NOT have a non-graphical browser. Besides that, not supporting CSS is a right that browsers have and you are not to tell me what to use. A good website maker makes a site usable for any browser. And CSS makes that easy if used right, so stop complaining.
Note that I have seen your ";-)", but needed to say this because it's the third time I see someone suggesting something like this today.
| [reply] [Watch: Dir/Any] |
|
| [reply] [Watch: Dir/Any] |
Re: IE's conditional comments
by ww (Archbishop) on Nov 05, 2004 at 18:30 UTC
|
interesting idea.
FWIW, tried with IE 6.x (changed IE element in the conditionals to "IE6") and Moz 1.7x. IE 6 honors the conditional comments; Moz renders the negative conditionals which return true.
Speculating now but Moz behavior may be because it demands w3c standard comments, < followed by two hyphens for open_comment and two hyphens > for close_comment.
(3.2.4) White space is not permitted between the markup declaration open delimiter("<!") and the comment open delimiter ("--"), but is permitted between the comment close delimiter ("--") and the markup declaration close delimiter (">"). A common error is to include a string of hyphens ("---") within a comment. Authors should avoid putting two or more adjacent hyphens inside comments.
from: http://www.w3.org/TR/html4/intro/sgmltut.html#idx-HTML
Would like to know more about which "IE oddities" lead to what thoughts about working around them. A link to a reference on the workings of the square bracket mechanism here would be nice to have, if permitted | [reply] [Watch: Dir/Any] |
Re: Should we change linking so that conditional comments for IE are not destroyed?
by bart (Canon) on Nov 12, 2004 at 01:46 UTC
|
You don't really want conditional HTML, you want conditional CSS. There are other tricks to make CSS only work for MSIE, for example, see this for an example. According to that page, you can specify CSS style properties with a leading "_" prefix, and only MSIE will pick it up (coloured blue in the syntax highlighted HTML example). I haven't tried it, but it is worth a shot.
Googling for CSS underscore hack, and following some links, I ended up on this page: The Underscore Hack.
| [reply] [Watch: Dir/Any] |
Re: Should we change linking so that conditional comments for IE are not destroyed?
by ysth (Canon) on Nov 07, 2004 at 05:53 UTC
|
Simple solution: in the square bracket mangling code,
pass through [-b0rk-foo-protect] as literal [foo]. | [reply] [Watch: Dir/Any] [d/l] [select] |
|
| [reply] [Watch: Dir/Any] [d/l] [select] |
|
Sounds reasonable; there are 77+ nodes with titles starting [, but I think all of them have a ], so there's no way to link to them by name now anyway.
| [reply] [Watch: Dir/Any] |
|