IE <-> Mozilla is driving me insane.
|
|
Thread rating:  |
dip@butter.toast.net - 28 Mar 2005 20:41 GMT pardon the coversational manner of my thread subject. i'm having issues with the way that the two browsers handle CSS.
this is an element i've defined in my style sheet.
=========== sm { font: 10px arial; color: #53278F; } ===========
in mozilla, i can insert this tag anywhere i want, and the browser renders it fine. (ie. <sm>this is text</sm>)
IE ignores the tag completely.
if i create an element that looks like this...
=========== .small { font: 10px arial; color: #53278F; } ===========
... and then use it as a "div class," IE mostly gets it right. (ie. <div class="small">this is text</div>
am i doing something "wrong?" is one of these methods "more correct" than the other?
i'm at the point where i want to scrap CSS altogether and go back to defining fonts inline. at least then i had a pretty good idea of how they would render. (i won't even go into the "tableless" nonsense.)
Jim Moe - 28 Mar 2005 20:57 GMT > this is an element i've defined in my style sheet. > =========== [quoted text clipped - 7 lines] > > IE ignores the tag completely. You must prepend a dot (".") to the class name: ".sm". IE only implements a subset of CSS and parts of that are poorly done.
 Signature jmm dash list (at) sohnen-moe (dot) com (Remove .AXSPAMGN for email)
dip@butter.toast.net - 28 Mar 2005 21:11 GMT these might be a dumb questions:
if i prepend a dot to anything, do i have to use <div class="sm"></div> in the HTML?
should i make sure all of my style elements are .something, and always use div?
Steve Pugh - 28 Mar 2005 21:20 GMT >if i prepend a dot to anything, do i have to use <div class="sm"></div> >in the HTML? .foo is the CSS selector for any element with class="foo" in the HTML.
.foo matches <div class="foo">...</div> and <p class="foo">...</p> and <strong class="foo">...</strong>
p.foo only matches <p class="foo">...</p>
>should i make sure all of my style elements are .something, and always >use div? No. Use the most appropriate HTML element for the content you are marking up. Then add CSS on top of that as needed.
Steve
 Signature "My theories appal you, my heresies outrage you, I never answer letters and you don't like my tie." - The Doctor
Steve Pugh <steve@pugh.net> <http://steve.pugh.net/>
kaeli - 28 Mar 2005 21:21 GMT > should i make sure all of my style elements are .something, and always > use div? Or a span. Or a paragraph. Or whatever you want. A .something can apply to any element as long as what you have in there applies to the element you're using it on.
.bordered { border: 1px solid navy; }
<p class="bordered">yada yada</p> <table class="bordered"> ...</table>
Or if you almost always want an element to look some way, say all your emphasized elements should be black and bold unless you specify otherwise, do
em { color: black; font-weight: bold; }
em.purple { color: purple; font-weight: bold; }
<em>this is normal emphasized text</em> <em class="purple">this is purple emphasized text</em>
Note that you can do this because the EM element already exists, unlike your SM example.
 Signature -- ~kaeli~ He had a photographic memory that was never developed. http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace
C A Upsdell - 28 Mar 2005 21:09 GMT > pardon the coversational manner of my thread subject. > i'm having issues with the way that the two browsers handle CSS. [quoted text clipped - 5 lines] > color: #53278F; > } There is no such tag as 'sm' in HTML, so AFAIK you can't set CSS properties for it. Mozilla accepts it, but I don't know why.
> if i create an element that looks like this... > [quoted text clipped - 5 lines] > ... and then use it as a "div class," IE mostly gets it right. > (ie. <div class="small">this is text</div> Instead of using:
font: 10px arial;
I would suggest that you use:
font-size:10px; font-family:Arial, sans-serif;
since I seem to remember that some older browsers don't handle the first as well.
You say "IE mostly gets it right": please be more specific; give an example with a URL.
Rijk van Geijtenbeek - 29 Mar 2005 09:30 GMT ..
> Instead of using: > [quoted text clipped - 6 lines] > since I seem to remember that some older browsers don't handle the first > as well. Maybe some browser from 1996... I can't recall anything released after 1999 that has a problem with the 'font' shorthand rule.
 Signature Rijk van Geijtenbeek
The Web is a procrastination apparatus: It can absorb as much time as is required to ensure that you won't get any real work done. - J.Nielsen
Steve Pugh - 28 Mar 2005 21:09 GMT >this is an element i've defined in my style sheet. > [quoted text clipped - 5 lines] >in mozilla, i can insert this tag anywhere i want, and the browser >renders it fine. (ie. <sm>this is text</sm>) Is this an HTML or an XML document? You can't just invent HTML elements at your whim.
And why invent a <sm> element when the <small> element already exists, isn't deprecated and could easily be given the above styles by your style sheet?
>IE ignores the tag completely. > [quoted text clipped - 7 lines] >... and then use it as a "div class," IE mostly gets it right. >(ie. <div class="small">this is text</div> How does IE only get it "mostly" right? What does IE get wrong?
>am i doing something "wrong?" Using px for font sizes. Setting a specific font-family without setting a generic family. Setting a colour without setting a background colour. Using a class name that refers to what the class looks like rather than what it is.
>is one of these methods "more correct" than the other? The second method is "less incorrect".
>i'm at the point where i want to scrap CSS altogether and go back to >defining fonts inline. at least then i had a pretty good idea of how >they would render. >(i won't even go into the "tableless" nonsense.) Okay, we won't go into helping you.
Steve
 Signature "My theories appal you, my heresies outrage you, I never answer letters and you don't like my tie." - The Doctor
Steve Pugh <steve@pugh.net> <http://steve.pugh.net/>
dip@butter.toast.net - 28 Mar 2005 21:45 GMT >Is this an HTML or an XML document? >You can't just invent HTML elements at your whim. it's HTML. and apparently i can, so long as i'm only viewing the page with Mozilla.
>And why invent a <sm> element when the <small> element already exists, >isn't deprecated and could easily be given the above styles by your >style sheet? it was just an example... and yes, you're right.
>How does IE only get it "mostly" right? What does IE get wrong? well, in continuing to develop my apparently very incorrect style sheet, i tried to create superscript.
sup { font:10px arial; color: #53278F; vertical-align: 20%; }
IE appears to ignore the vertical align element.
i'm sorry if i'm asking the question the wrong way, or if my lack of knowledge is somehow offensive. i hope that in asking stupid questions, someday i might be as cool as you.
Beauregard T. Shagnasty - 28 Mar 2005 22:23 GMT >> Is this an HTML or an XML document? You can't just invent HTML >> elements at your whim. > > it's HTML. No, it's not.
> and apparently i can, so long as i'm only viewing the > page with Mozilla. Apparently, Mozilla is mis-interpreting it as xml/xhtml or something else. It is not html.
> well, in continuing to develop my apparently very incorrect style > sheet, i tried to create superscript. > > sup { font:10px arial; color: #53278F; vertical-align: 20%; } sup { font:70% arial, sans-serif; color: #53278F; vertical-align: 20%;}
..seems to work for me in Firefox and IE6. (Don't use px/pt for font sizes, and specify a generic fallback.) I have good luck using line-height: 0; instead of a vertical-align.
> IE appears to ignore the vertical align element. Which version?
> i'm sorry if i'm asking the question the wrong way, There is a knack to it...
> or if my lack > of knowledge is somehow offensive. i hope that in asking stupid > questions, someday i might be as cool as you. Um, statements like that don't help.
 Signature -bts -This space intentionally left blank.
Steve Pugh - 28 Mar 2005 23:13 GMT >well, in continuing to develop my apparently very incorrect style >sheet, i tried to create superscript. [quoted text clipped - 4 lines] > vertical-align: 20%; >} If you had any problems using google to look up why px for font size, font family with no generic family, and colour with no background colour are problems then you can always ask here (the middle one is actually debatable but the first and last are sound advice).
Now, do you want your superscripts to be a different colour and font to the surrounding text? Normally you don't so you wouldn't set those properties. Just font-size and vertical-align and/or line-height.
>IE appears to ignore the vertical align element. Seems to work here. The baseline of the superscript is roughly 20% above the baseline of the rest of the text (IOW somewhat lower than the unstyled baseline for superscripts) in IE5.01, IE6, Firefox 1.0 and Opera 8b3.
>i'm sorry if i'm asking the question the wrong way, or if my lack of >knowledge is somehow offensive. i hope that in asking stupid >questions, someday i might be as cool as you. It's eleven o'clock on a bank holiday Monday and I'm at home posting to Usenet. If you think I'm cool then your life must really suck.
Steve
 Signature "My theories appal you, my heresies outrage you, I never answer letters and you don't like my tie." - The Doctor
Steve Pugh <steve@pugh.net> <http://steve.pugh.net/>
me - 29 Mar 2005 01:07 GMT > >Is this an HTML or an XML document? > >You can't just invent HTML elements at your whim. [quoted text clipped - 26 lines] > knowledge is somehow offensive. i hope that in asking stupid > questions, someday i might be as cool as you. You're cool I'm cool everybody in this NG is cool (well almost).
Look here for a CSS browser compatibality chart: http://www.corecss.com/properties/full-chart.php
Look below for an example I made just for you: Good Luck, me
<html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- body { font-family: Arial, Helvetica, sans-serif; font-size: 10px} .super { vertical-align: super} .red { color: #FF0000} .superred { color: #FF0000; vertical-align: super} --> </style> </head>
<body bgcolor="#FFFFFF"> <p>10px initial body font size</p> <p class="super">everything on this line is super but you can't tell </p> <p><span class="super">this is super</span> this isn't super even though it's on the same line</p> <p class="red">everything on this line is red</p> <p><span class="red">this is red</span> this isn't red</p> <p><span class="superred">this is super and red</span> this isn't super or red</p> </body> </html>
kaeli - 29 Mar 2005 14:38 GMT > <style type="text/css"> > <!-- Are there any browsers left that don't understand style enough to need the html comments here? I haven't been using those anymore...should I be?
 Signature -- ~kaeli~ Dancing cheek-to-cheek is really a form of floor play. http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace
me - 29 Mar 2005 15:54 GMT > > <style type="text/css"> > > <!-- > > Are there any browsers left that don't understand style enough to need the > html comments here? > I haven't been using those anymore...should I be? If your asking me then my answer to both questions is I don't know. As I have already explained to you I use Dreamweaver (albeit an older version) which automatically inserts those comments (and other bits which you may also find offensive/irrelevant). I could delete these tags but why bother, AFAICT they do no harm. Signed, me
kaeli - 29 Mar 2005 17:53 GMT > > In article <114h73tn4smg50f@corp.supernews.com>, anonymous@_.com > enlightened [quoted text clipped - 11 lines] > also find offensive/irrelevant). I could delete these tags but why bother, > AFAICT they do no harm. I wasn't worried about them doing harm if left in -- I was worried I was screwing up someone's browser by NOT putting them in.
Thanks.
 Signature -- ~kaeli~ What, me, normal? http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace
Alan J. Flavell - 29 Mar 2005 19:31 GMT [ about <!-- ... --> around inlined CSS ]
> I wasn't worried about them doing harm if left in But I'd suggest you /should/ be. An XHTML-aware browser must disregard any inlined CSS which is enclosed in those comment markers, at least when rendering XHTML.
OK, so XHTML/1.0 Appendix C deals with HTML browsers trying to render XHTML; but maybe it's already time to start considering XHTML browsers rendering (or trying to render) HTML.
> -- I was worried I was screwing up someone's browser by NOT putting > them in. Those would be browsers which pre-date support for HTML/3.2. Such browsers typically also did not support name-based virtual hosts, and, for that reason alone, would be practically useless on the present-day WWW.
h t h
kaeli - 29 Mar 2005 20:12 GMT > [ about <!-- ... --> around inlined CSS ] > > > I wasn't worried about them doing harm if left in > > But I'd suggest you /should/ be. To clarify: I wasn't worried about it because I already don't do it. *smiles*
But thanks.
 Signature -- ~kaeli~ The definition of a will?... (It's a dead giveaway.) http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace
Lauri Raittila - 29 Mar 2005 16:37 GMT > > <style type="text/css"> > > <!-- > > Are there any browsers left that don't understand style enough to need the > html comments here? Last browser that did that was NN2 IIRC.
> I haven't been using those anymore...should I be? No.
 Signature Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts> Utrecht, NL.
kaeli - 29 Mar 2005 17:32 GMT > > > <style type="text/css"> > > > <!-- [quoted text clipped - 7 lines] > > No. Thanks. That's good, because I don't. :)
Just checking.
 Signature -- ~kaeli~ What, me, normal? http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace
me - 29 Mar 2005 17:15 GMT > > <style type="text/css"> > > <!-- [quoted text clipped - 3 lines] > I haven't been using those anymore...should I be? > ~kaeli~ I deleted this tag: <style type="text/css"> and tested the result in IE6, the style was ignored. Signed, me
Beauregard T. Shagnasty - 29 Mar 2005 17:21 GMT >> In article <114h73tn4smg50f@corp.supernews.com>, anonymous@_.com > [quoted text clipped - 11 lines] > I deleted this tag: <style type="text/css"> and tested the result > in IE6, the style was ignored. kaeli was referring (and mentioned) the HTML *comment* tags:
<!-- and -->
that some folks put in the <style> element. They are not needed. Naturally, you cannot remove the <style> element itself, if you want them to be recognized.
 Signature -bts -This space intentionally left blank.
me - 29 Mar 2005 18:05 GMT > >> In article <114h73tn4smg50f@corp.supernews.com>, anonymous@_.com > > [quoted text clipped - 19 lines] > Naturally, you cannot remove the <style> element itself, if you want > them to be recognized. Thank you for the clarification. To be specific though here is all of the tags he cited in his text: <style type="text/css"> <!-- See kaeli post above. Signed, me
Beauregard T. Shagnasty - 29 Mar 2005 18:15 GMT > Thank you for the clarification. To be specific though here is all > of the tags he cited in his text: > <style type="text/css"> > <!-- > See kaeli post above. Right, and followed by: "Are there any browsers left that don't understand style enough to need the html comments here?"
Seemed plain enough to me what he meant. If he had only written "<!--" without the style element for context, it would have made far less sense to the average reader.
 Signature -bts -This space intentionally left blank.
kaeli - 29 Mar 2005 20:10 GMT > Seemed plain enough to me what he meant. If he had only written "<!--" > without the style element for context, it would have made far less > sense to the average reader. I'M A GIRL. ;)
 Signature -- ~kaeli~ The definition of a will?... (It's a dead giveaway.) http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace
Beauregard T. Shagnasty - 29 Mar 2005 21:49 GMT >> Seemed plain enough to me what [s]he meant. If [s]he had only >> written "<!--" without the style element for context, it would >> have made far less sense to the average reader. > > I'M A GIRL. ;) Pictures? <lol>
 Signature -bts -This space intentionally left blank.
me - 29 Mar 2005 23:21 GMT > > Thank you for the clarification. To be specific though here is all > > of the tags he cited in his text: [quoted text clipped - 8 lines] > without the style element for context, it would have made far less > sense to the average reader. Misunderstanding due to haste, failing eyesight, micro text in NG reader, etc etc etc. Signed, me
Beauregard T. Shagnasty - 29 Mar 2005 23:37 GMT > Misunderstanding due to haste, failing eyesight, micro text in NG > reader, etc etc etc. NG { font-size: 10px; } ??? :-)
 Signature -bts -This space intentionally left blank.
me - 30 Mar 2005 00:06 GMT > > Misunderstanding due to haste, failing eyesight, micro text in NG > > reader, etc etc etc. > > NG { font-size: 10px; } ??? :-) I obfuscated, but not totally. :-) Signed, me
|
|
|