![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| 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: * 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 |
|
|||||||
| Web Design & Programming Discussion of web design, and server-side & client-side scripting |
![]() |
|
|
Thread Tools |
|
|
#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.
|
|
|
|
|
|
#2 (permalink) |
|
Design Team Member
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 |
|
|
|
|
|
#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}
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> 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. |
|
|
|
|
|
#4 (permalink) |
|
Design Team Member
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 |
|
|
|
|
|
#6 (permalink) |
|
Design Team Member
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 |
|
|
|
![]() |
| Thread Tools | |
|
|