Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 





Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > Design Forum > Web Design & Programming
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read

Web Design & Programming Discussion of web design, and server-side & client-side scripting

Reply
 
Thread Tools
Old 08-28-2008, 06:04 PM   #1 (permalink)
Registered User
 
Join Date: May 2008
Posts: 13
OS: XP


[Solved]CSS with IE and Firefox

Hi! I've been messing around with CSS and my html pages display properly in IE but not in Firefox. I'm not talking about subtle differences, either. Firefox doesn't seem to know a style sheet even exists; there is no formatting at all. It's probably something dumb, but I can't figure it out.
tomwbro is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 08-28-2008, 06:10 PM   #2 (permalink)
Design Team Member
 
jamiemac2005's Avatar
 
Join Date: Jul 2007
Location: Northampton, UK
Posts: 1,090
OS: Win Vista Home Premium & Ubuntu Hardy(8.04)


Re: CSS with IE and Firefox

Hey, could you post the code to your entire webpage(so we can see exactly what's going on in the page)...

Cheers,
Jamey
__________________

Help fight cancer. < I just started =]
jamiemac2005 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 08-29-2008, 09:44 AM   #3 (permalink)
Registered User
 
Join Date: May 2008
Posts: 13
OS: XP


Re: CSS with IE and Firefox

Hi Jamey!

These are the basic files I'm using to do the testing:

mystyles.css
Code:
H2 {font: bold 18pt Verdana, Arial, Helvetica; color: Red}
H3 {font: bold 16pt Verdana, Arial, Helvetica; color: Navy}
test2.html
HTML Code:
<html>

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

<title>My Home Page</title>

<body>
<h2>This text should be red.</h2>
<h3>This text should be navy.</h3>
</body>
</html>
*Note that in my code I have "href=C:/css/mystyles.css" but when I posted it here using the <>[html] feature it removed the "C:/". It won't work for me (in IE) without having the "C:/" in the code. It won't work either way in Firefox.

The link in the <head> section references the directory where the .css file is saved. I tried saving the .html and the .css files in the same directory to see if that would make a difference, but it didn't. The above code works in IE but not Firefox. I'm using IE7 and Firefox 3.0.1 with Notepad++ as my editor. I appreciate the help.
tomwbro is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 08-29-2008, 04:14 PM   #4 (permalink)
Design Team Member
 
jamiemac2005's Avatar
 
Join Date: Jul 2007
Location: Northampton, UK
Posts: 1,090
OS: Win Vista Home Premium & Ubuntu Hardy(8.04)


Re: CSS with IE and Firefox

You should be using relative links in hrefs etc. If you don't the user's pc will be looked for, wheres the .html file stored? (the full path because we can work it out from there)...

Cheers,
Jamey
__________________

Help fight cancer. < I just started =]
jamiemac2005 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 08-29-2008, 08:30 PM   #5 (permalink)
Registered User
 
Join Date: May 2008
Posts: 13
OS: XP


Re: CSS with IE and Firefox

What do you mean by relative link?

The .css file is stored in:
C:/css/mystyles.css

The .html file is stored in:
C:/webpage/test2.html

Thanks for your help.
tomwbro is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 08-30-2008, 06:20 AM   #6 (permalink)
Design Team Member
 
jamiemac2005's Avatar
 
Join Date: Jul 2007
Location: Northampton, UK
Posts: 1,090
OS: Win Vista Home Premium & Ubuntu Hardy(8.04)


Re: CSS with IE and Firefox

Okay, you have direct file links which are anything that starts with a drive letter or network drive path ("C:/")... An absolute reference would be one with the website's main url at the start of it ("http://www.blah.com/theUrl").

The problem with this is that when you upload it C:/ is not the same (because it's on someone elses pc[most browsers don't allow using a C:/ link so you get the problem you're having])...

You have to use a relative url (The url is relative to the page it's on)...

So the link for the .css file would become "../css/mystyles.css" (The ".." stands for up a directory). Then when you upload them you have to ensure it's within the same directorys on the web.

Here's a tutorial on the subject: http://www.webreference.com/html/tutorial2/3.html

Cheers,
Jamey
__________________

Help fight cancer. < I just started =]
jamiemac2005 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 08-30-2008, 10:15 AM   #7 (permalink)
Registered User
 
Join Date: May 2008
Posts: 13
OS: XP


Re: CSS with IE and Firefox

Well, how 'bout that? You learn something new everyday. Thanks, Jamey. You're a genius.
tomwbro is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -7. The time now is 03:39 PM.



Copyright 2001 - 2008, Tech Support Forum

Search Engine Friendly URLs by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82