2
   

Problem with CSS

 
 
TLomon
 
Reply Wed 21 Jul, 2004 04:44 am
I recently tried working with CSS, and I am having a problem implementing some of the stuff. First, the code.

CSS File:
Code:<style type="text/css">
<!--
body { background=black;
color:white;
lang=EN-US;
tab-interval:.5in; }
h1 { text-align:center;
font-size:36.0pt;
font-family:Arial;
font-weight:bold; }
h2 { text-align:center;
color:red; }
h3 { text-align:center;
color:blue; }
-->
</style>


HTML File:
Code:<html>
<head>
<link media=screen rel=stylesheet href="library.css" type="text/css">
</head>

<body>
<h1>Main Header</h1>
<h2>Specific Information About Header</h2>
<h3>Personal Notes About Header</h3>

<p>Text. Tons of text. No special formating what so ever.</p>
</body>
</html>


For some reason, I can't get the CSS to work at all. It is as if the link was never added. However, if I copy the style information to the main HTML document, it comes out perfectly. Any suggestions would be greatly appreciative.
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 2 • Views: 3,412 • Replies: 10
No top replies

 
Craven de Kere
 
  1  
Reply Wed 21 Jul, 2004 11:28 am
Try removing media=screen
0 Replies
 
TLomon
 
  1  
Reply Wed 21 Jul, 2004 01:46 pm
No change. Still not loading anything from the css file.
0 Replies
 
Craven de Kere
 
  1  
Reply Wed 21 Jul, 2004 02:21 pm
Well then maybe something I took for granted is the problem.

You do realize that teh external CSS file should look like this right?

Code:body { background=black;
color:white;
lang=EN-US;
tab-interval:.5in; }
h1 { text-align:center;
font-size:36.0pt;
font-family:Arial;
font-weight:bold; }
h2 { text-align:center;
color:red; }
h3 { text-align:center;
color:blue; }


You ahve it formatted for on-page CSS, and I assumed you change it for the external css file, but if not do so.
0 Replies
 
TLomon
 
  1  
Reply Wed 21 Jul, 2004 02:40 pm
/chuckle. Actually, don't assume anything of me. This is the very first time I have used CSS. Made your recommended changes. Still no change. Here are views of the current code.

CSS File
Code:body { background=black;
color:white;
lang=EN-US;
tab-interval:.5in; }
h1 { text-align:center;
font-size:36.0pt;
font-family:Arial;
font-weight:bold; }
h2 { text-align:center;
color:red; }
h3 { text-align:center;
color:blue; }


HTML File
Code:<html>
<head>
<link rel=stylesheet href="library.css" type="text/css">
</head>

<body>
<h1>Main Header</h1>
<h2>Specific Information About Header</h2>
<h3>Personal Notes About Header</h3>

<p>Text. Tons of text. No special formating what so ever.</p>
</body>
</html>
0 Replies
 
Craven de Kere
 
  1  
Reply Wed 21 Jul, 2004 02:50 pm
Ok, is the CSS file called library.css and is it saved in the same directory as the html file?
0 Replies
 
TLomon
 
  1  
Reply Wed 21 Jul, 2004 05:53 pm
Correct on both. Also, both files are all lower case, including the extensions.
0 Replies
 
TLomon
 
  1  
Reply Wed 21 Jul, 2004 05:59 pm
Ok, this is wierd. It works on my work system. Mmm.... need to do a quick test.
0 Replies
 
TLomon
 
  1  
Reply Wed 21 Jul, 2004 06:05 pm
Ok, it appears to be working perfectly now. But I am at work. Also, my library.css file was missing from the website. Very strange. Will need to go home and check my logs. Perhaps I uploaded it to the wrong directory or something.
0 Replies
 
Craven de Kere
 
  1  
Reply Wed 21 Jul, 2004 07:52 pm
Maybe your browser had cached an earlier flawed version of the external css.
0 Replies
 
TLomon
 
  1  
Reply Thu 22 Jul, 2004 01:13 am
Well, got it working. But it is strange how I had to do it. I examined the code between the working files at work, and the non-working files at home. They were identical, except for spacing.

I ended up deleting the garbage at home. Created two new files right from the get go, and tada, everything works.

I am not sure if there was file corruption, or perhaps it didn't like tabs... no clue. Anyway, I am glad it is now working. Thanks again for your help.
0 Replies
 
 

Related Topics

Webdevelopment and hosting - Question by harisit2005
Showing an Ico File - Discussion by Brandon9000
how to earn money in internet - Discussion by rizwanaraj
The version 10 bug. Worse then Y2K! - Discussion by Nick Ashley
CSS Border style colors - Question by meesa
There is no Wisdom in Crowds - Discussion by ebrown p
THANK YOU CRAVEN AND NICK!!! - Discussion by dagmaraka
I'm the developer - Discussion by Nick Ashley
 
  1. Forums
  2. » Problem with CSS
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 04/24/2024 at 03:38:20