5 replies [Last post]
KyferEz
Offline
newbie
Last seen: 11 years 1 week ago
Joined: 2004-08-17
Posts: 3
Points: 0

I have been working on a website for a while. I am beginning to use CSS for all my fonts, and thought I had it all figured out when I discovered that Internet Explorer does not properly display my fonts. However, when viewed in Mozilla, it works fine.

Take a look at this page:
http://www.markgrenellarchitect.com/test.html

Here is the link to the stylesheet used in the page:
http://www.markgrenellarchitect.com/basicstyle.css

Note the new elements n1, n2, inv1, inv2, etc.? Well, this works fine in Mozilla and it displays exactly right. However, when viewed in IE, it ignores the use of <n1> and <n2> elements.

If I do a CSS Validation, I don't get any errors.
If I do a W3C Markup Validation I get this error:
"Line 154, column 15: element "N2" undefined
<n2>New Hanover Medical Specialists</n2></td>"

I must not be doing something correctly, but I can't seem to figure it out. Any help pointing out my stupid mistake is greatly appreciated.

Does noone know what is wrong? This post has been here for a while, and I have to have this fixed!

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 4 days 1 hour ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

Trouble with CSS fonts in IE. Am I doing it wrong?

Hi KyferEz,
What are the "n1" and "n2" tags ?
I'd say IE like me has know idea what an n? tag is supposed to do.
Actually it's suprising to me that Netscape displays them correctly.
I thought this may be something to do with XML which I don't have a great understanding of, but if it is you are using the wrong doctype.

Hope that helps

KyferEz
Offline
newbie
Last seen: 11 years 1 week ago
Joined: 2004-08-17
Posts: 3
Points: 0

Trouble with CSS fonts in IE. Am I doing it wrong?

n1 and n2 are tags I made up. I read through some of a CSS manual at and thought that you could make up new font tags, and even have font classes if you wanted. If you look at the basicstyle.css file you see I am trying to define n1, n2, etc. as font styles. Am I incorrect in doing this, or in how I am applying them?

KyferEz
Offline
newbie
Last seen: 11 years 1 week ago
Joined: 2004-08-17
Posts: 3
Points: 0

Trouble with CSS fonts in IE. Am I doing it wrong?

I figured it out:
I needed to make things like "n1" into CSS classes, since they are not actual HTML elements. For instance, changing the CSS for the n1 element to:

code:.n3 {font-family: etc....}

Then wherever I wanted that effect, add a "class" parameter to the applicable HTML tag:

code:<td class=n3 width="15%" valign="middle">Wilmington, NC</td>

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 4 days 1 hour ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

Trouble with CSS fonts in IE. Am I doing it wrong?

Hi KyferEz,
Glad you worked it out.

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 45 weeks 8 hours ago
Joined: 2004-06-30
Posts: 9668
Points: 801

Trouble with CSS fonts in IE. Am I doing it wrong?

Absolutely correct, you can't make up tags, you can make up classes. Not too sure how netscape displayed them properly though.

You use periods (.) for classes and hashes (#) for IDs.

IDs are useful for positioning divs, classes are useful for styling things.

Verschwindende wrote:
  • CSS doesn't make pies