473,320 Members | 1,887 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

IE <-> Mozilla is driving me insane.

dip
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.)

Jul 21 '05 #1
27 2267
di*@butter.toast.net wrote:
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.

You must prepend a dot (".") to the class name: ".sm". IE only
implements a subset of CSS and parts of that are poorly done.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jul 21 '05 #2
di*@butter.toast.net wrote:
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;
}
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...

.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>


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.
Jul 21 '05 #3
di*@butter.toast.net wrote:
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>)
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.

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>
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

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 21 '05 #4
dip
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?

Jul 21 '05 #5
di*@butter.toast.net wrote:
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

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 21 '05 #6
In article <11**********************@f14g2000cwb.googlegroups .com>,
di*@butter.toast.net enlightened us with...

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.

--
--
~kaeli~
He had a photographic memory that was never developed.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 21 '05 #7
dip
>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.

Jul 21 '05 #8
di*@butter.toast.net wrote:
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.

--
-bts
-This space intentionally left blank.
Jul 21 '05 #9
di*@butter.toast.net wrote:
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%;
}
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

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 21 '05 #10
me
<di*@butter.toast.net> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
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.


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>
Jul 21 '05 #11
On Mon, 28 Mar 2005 21:09:47 +0100, C A Upsdell
<""cupsdellXXX"@-@-@XXXupsdell.com"> wrote:

...
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.


Maybe some browser from 1996... I can't recall anything released after
1999 that has a problem with the 'font' shorthand rule.

--
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

Jul 21 '05 #12
In article <11*************@corp.supernews.com>, anonymous@_.com enlightened
us with...
<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?

--
--
~kaeli~
Dancing cheek-to-cheek is really a form of floor play.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 21 '05 #13
me
"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
In article <11*************@corp.supernews.com>, anonymous@_.com enlightened us with...
<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
Jul 21 '05 #14
in comp.infosystems.www.authoring.stylesheets, kaeli wrote:
In article <11*************@corp.supernews.com>, anonymous@_.com enlightened
us with...
<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.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Utrecht, NL.
Jul 21 '05 #15
me
"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
In article <11*************@corp.supernews.com>, anonymous@_.com enlightened us with...
<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?
~kaeli~


I deleted this tag: <style type="text/css"> and tested the result in IE6,
the style was ignored.
Signed,
me
Jul 21 '05 #16
me wrote:
"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
In article <11*************@corp.supernews.com>, anonymous@_.com


enlightened
us with...
<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? ~kaeli~


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.

--
-bts
-This space intentionally left blank.
Jul 21 '05 #17
In article <MP************************@news.individual.net> ,
la***@raittila.cjb.net enlightened us with...
in comp.infosystems.www.authoring.stylesheets, kaeli wrote:
In article <11*************@corp.supernews.com>, anonymous@_.com enlightened
us with...
<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.


Thanks.
That's good, because I don't. :)

Just checking.

--
--
~kaeli~
What, me, normal?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 21 '05 #18
In article <11*************@corp.supernews.com>, anonymous@_.com enlightened
us with...
"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
In article <11*************@corp.supernews.com>, anonymous@_.com

enlightened
us with...
<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.


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.

--
--
~kaeli~
What, me, normal?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 21 '05 #19
me
"Beauregard T. Shagnasty" <a.*********@example.invalid> wrote in message
news:lg****************@twister.nyroc.rr.com...
me wrote:
"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
In article <11*************@corp.supernews.com>, anonymous@_.com


enlightened
us with...

<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? ~kaeli~


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.


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
Jul 21 '05 #20
me wrote:
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.

--
-bts
-This space intentionally left blank.
Jul 21 '05 #21
On Tue, 29 Mar 2005, kaeli wrote:

[ 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
Jul 21 '05 #22
In article <13********************@twister.nyroc.rr.com>,
a.*********@example.invalid enlightened us with...

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. ;)

--
--
~kaeli~
The definition of a will?... (It's a dead giveaway.)
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 21 '05 #23
In article <Pi*******************************@ppepc56.ph.gla. ac.uk>,
fl*****@ph.gla.ac.uk enlightened us with...
On Tue, 29 Mar 2005, kaeli wrote:

[ 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.

--
--
~kaeli~
The definition of a will?... (It's a dead giveaway.)
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 21 '05 #24
kaeli wrote:
In article <13********************@twister.nyroc.rr.com>,
a.*********@example.invalid enlightened us with...
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>

--
-bts
-This space intentionally left blank.
Jul 21 '05 #25
me
"Beauregard T. Shagnasty" <a.*********@example.invalid> wrote in message
news:13********************@twister.nyroc.rr.com.. .
me wrote:
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.


Misunderstanding due to haste, failing eyesight, micro text in NG reader,
etc etc etc.
Signed,
me
Jul 21 '05 #26
me wrote:
Misunderstanding due to haste, failing eyesight, micro text in NG
reader, etc etc etc.


NG { font-size: 10px; } ??? :-)

--
-bts
-This space intentionally left blank.
Jul 21 '05 #27
me
"Beauregard T. Shagnasty" <a.*********@example.invalid> wrote in message
news:qM*********************@twister.nyroc.rr.com. ..
me wrote:
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
Jul 21 '05 #28

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jonny T | last post by:
hi, i want to echo the string '<?php' in a php script like : echo "<?php"; but when i try nothing gets displayed ... if I use echo "<\?php";
7
by: haoren | last post by:
Can anybody help me with this problem: How can I echo a string that contain <? and <?php? For example, $str="test <? and <?php echo"; echo $str;
3
by: winderjj | last post by:
Hi All, I need everyones opinion. I am very new to XML but am temporarily putting all my efforts into using it. This is what I need to do. Write an xml parser (in C) that will parse a...
4
by: matatu | last post by:
Hi to all, I have a xml file, a substring like: &lt;a href=&quot;#&quot;&gt;text&lt;/a&gt; which after an xslt trasform is rendered as (using xsl:output method html): &lt;a...
4
by: higabe | last post by:
Three questions 1) I have a string function that works perfectly but according to W3C.org web site is syntactically flawed because it contains the characters </ in sequence. So how am I...
5
by: tobbe | last post by:
Hi Im trying to load a XmlDataDocument with the following xml: <ROOT> <NAME> &LT; &AMP; &GT; " '</NAME> </ROOT> And i know I have a entity problem here, but i cant find any solution for...
10
by: Jon Noring | last post by:
Out of curiosity, may a CDATA section appear within an attribute value with datatype CDATA? And if so, how about other attribute value datatypes which accept the XML markup characters? To me,...
4
by: Armel Asselin | last post by:
Hello, I've been using XML for a while in a rather 'free' manner (i.e. as long as IE accept it it's OK), I read recently (again) the Xml standard 1.0 (3rd edition) and found this sentence: ...
4
by: spibou | last post by:
I saw it at http://www.faqs.org/rfcs/rfc1305.html Is it not the same as writing ``if (m)'' ?
3
by: webmasterATflymagnetic.com | last post by:
Folks, I'm struggling to put the question together, but I have this problem. I have written an HTML form that I can use for data entry. This uses PHP to write a SQL UPDATE command that gets...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.