...

View Full Version : IE acceptable CSS - Help



LostLedny
09-20-2006, 08:10 PM
Hello,

I am designing a website for my band, and last night, I did my first cross-browser reference. I personally run Firefox, but then I went onto my mothers computer and used IE and it refuses to load my external CSS file, and if it does load it, it refuses to read and interperate any of it correctly. My file is short and I use it solely for paragraphs and links. I will post a link to my site, and include my CSS file in this post. Any help as to converting my css file to be read correctly by IE would be greatly appreciated.

My Website (http://www.techamongous.com/unreal/lostledny2/home.html)


p{font-size: 10px; color: #EEEEEE; font-family: ARIAL;}
p.sitemap{font-size: 9px; font-family: ARIAL; color: #EEEEEE; line-height: 1pt;}
p.news{font-size: 12px; font-family: ARIAL; color: #EEEEEE; font-weight: bold;}
p.divider{font-size: 9px; font-family: ARIAL; color: #AAAAAA;}
p.live{font-size: 10px; color: #EEEEEE; font-family: ARIAL; line-height: 4pt;}

a:link{color: #A2322E; text-decoration: none;}
a:visited{color: #A2322E; text-decoration: none;}
a:hover{color: #FFFFFF; text-decoration: underline;}

mark87
09-20-2006, 08:14 PM
It may not like the fact you have a space before the filename...

<link rel="stylesheet" type="text/css" href="main.css" />

You also don't have a DOCTYPE which could cause different browsers to render it differently, and I see some deprecated tags in there too...

LostLedny
09-20-2006, 08:16 PM
When I type in the <link rel... line, I do not include the spaces, I am unsure why that space gets added in. Could you reference me to an appropriate DOCTYPE line I could use?

mark87
09-20-2006, 08:19 PM
Maybe your FTP program or server is corrupting your files? :confused: ...edit, I see it's working in IE now though. :)

It's generally best to use a XHTML 1.0 DOCTYPE.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

With your current coding though you will have a lot of errors.

LostLedny
09-20-2006, 08:21 PM
What errors do I have in my coding?

mark87
09-20-2006, 08:25 PM
At the moment I'm not sure because it can't validate your page!

http://validator.w3.org/check?verbose=1&uri=http://www.techamongous.com/unreal/lostledny2/home.html

I said there will be errors though because XHTML requires all tags are closed, eg. "/>" for thing's like <br /> and <img /> etc, and you'd need to specify character encoding.

At the end of the day, most errors won't make a difference to how your page looks though, but most people will say "fix those errors!" :o

LostLedny
09-20-2006, 08:31 PM
Well, with the help I was able to get the CSS working in IE. I would like to fine tune my coding, because I do it all myself, and I would like to be as sound as I can with it.

So what you mean by ending all ym tags would mean:

<img src = "whatever.jpg" border = "0" />

What are other tags I would need to end like that?

I really appreciate all this help.

LostLedny
09-20-2006, 08:35 PM
I updated my home.html with all my <br> and <img> tags ended. What else can I do to refine my coding?

_Aerospace_Eng_
09-20-2006, 08:35 PM
Any tag that doesn't have a closing tag so for example, the <br> tag has no closing tag in HTML so you need to self close it like so <br />, same goes for <hr> tags, link tags. This is wrong

<html>
<head>
<title>Lost Ledny</title>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<link rel="stylesheet" type="text/css" href="main.css" />
</head>
change it to this

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Lost Ledny</title>
<link rel="stylesheet" type="text/css" href="main.css" />
</head>
There is a lot more that needs to be done. For example the stuff in your body tag should all be done in CSS. Same goes for other places that you use bgcolor. If it can be done in CSS then do it in CSS.

LostLedny
09-20-2006, 08:38 PM
So if though you end links with </a> I should still add the /> at the end of the initial tag?

<a href = "home.html />Home</a> ?

_Aerospace_Eng_
09-20-2006, 08:39 PM
No I said any tag that DOESN'T have a closing tag. An anchor tag does have one doesn't it? I added to my post above, reread it.

Has closing tag, don't self close

<a href="#">blah</a>
Has no closing tag, self close

<img src="blah.jpg" alt="" />
Has no closing tag, self close

<hr />
Has no closing tag, self close

<br />
Has no closing tag, self close

<link rel="stylesheet" href="style.css" type="text/css" />
Has no closing tag, self close

<input type="text" />

LostLedny
09-20-2006, 08:44 PM
My apologies, I thought of 'link tags' as the <a>. Thank you for your help and being patient with me. I will continue tweaking my coding.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum