Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why does my CSS sheet not work? 2

Status
Not open for further replies.

naiku

Technical User
Apr 25, 2002
346
US
Hi All

I am trying to use the following style sheet on my site:
<code>
<STYLE>
body {
BACKGROUND-Attachment: fixed;
BACKGROUND-Repeat: no-repeat;
BACKGROUND-Color: #FFFFFF;
COLOR #000000;
FONT-size: 12pt;
FONT-Family: 'arial';
FONT-Weight: bold;
MARGIN-Top: 5;
SCROLLBAR-FACE-COLOR: #00BFFF;
SCROLLBAR-HIGHLIGHT-COLOR: #00BFFF;
SCROLLBAR-SHADOW-COLOR: #000000;
SCROLLBAR-3DLIGHT-COLOR: #000000;
SCROLLBAR-ARROW-COLOR: #000000;
SCROLLBAR-TRACK-COLOR: #87CEFA;
SCROLLBAR-DARKSHADOW-COLOR: #00BFFF;
}
h1 { color:#00bfff;FONT-Weight: bold;text-align:center; }
h2 { color:#00bfff;FONT-Weight: bold;text-align:center; }
h3 { color:#00bfff;FONT-Weight: bold;text-align:left; }
ol { list-style-type:disc; }
A:link { color: 00BFFF; background:#FFFFFF }
A:visited { color: 800080; background:#FFFFFF }
A:hover { color: 0000FF; background:#FFFFFF }
A:active { color: 6495ED; background:#FFFFFF }
</STYLE>
</code>

When I use it as an internal sheet then it works fine, but when I try to use it as an external style sheet and link to it using <LINK rel=&quot;stylesheet&quot; href=&quot;main_style.css&quot; type=&quot;text/css&quot;> it only half works. The headers are the correct color and aligned where I want them but nothing else works. The text remains at Times New Roman (I think) and my list is a numbered list instead of a disc style. Is there something wrong with the way I am linking to it externally? I have put the <LINK> tag below the <title> tag and above the </head> tag. Can someone help please as I don't want to use it as an internal sheet as all the pages have the same formatting.

Thanks

Naiku
 
Ok I just realised the list is working properly too, its just the font that is not playing ball. Any help appreciated, I am pretty sure its going to be something simple....

Naiku
 
Hi,

Change
Code:
FONT-Family: 'arial';
to this:

Code:
FONT-Family: arial;
(No ' needed)

Cheers

James
 
Thanks for the reply, but it did not work. I still get the exact same thing, Times text not Arial yet every other aspect of the CSS works

Naiku
 
Hi,

I have IE 5.5 with all the bangs and whistles bolted on and it works fine for me, NS4 though won't even touch it.

What are you trying to view it in?

James
 
It also works in IE4.

Are you sure you don't have somewhere an old inline style you forgot to delete, because that overwrites the CSS.

Or <font> tags in your page? That will also overwrites the css.

Erik
<!-- My sport: Boomerang throwing !!
This year I will participate at the World Championships in Germany. (!! Many Happy Returns !! -->
 
I am using IE6 here, no font tags that I know of. Maybe I missed something though have posted the HTML along with this just incase I am missing the obvious that needs pointing out to me....

Code:
<html>
<head>
<title>Introduction to The company</title>
<LINK rel=&quot;stylesheet&quot; href=&quot;main_style.css&quot; type=&quot;text/css&quot;>
<body background=&quot;assets/images/center_cloud.jpg&quot;>
</head>
<body>
<h1>Introduction to the Company</h1>
<p>We are conveniently based close to the M3 in Basingstoke. The Company 
  supplies and installs a wide raing of air management systems throughout mainland 
  Britain</p>
<p> </p>
<p>The company was founded in 1964 and has seen steady growth over the years.</P>
<p>We can air condition any type of premises, some of which are listed below</p>
<ol>
  <li>Retail Oulets.</li>
  <li>Offices.</li>
  <li>Computer Server Rooms.</li>
  <li>Telecommunications Equipment.</li>
  <li>Fine Arts.</li>
  <li>Staff.</li>
  <li>TV Studios.</li>
  <li>Veterinary Surgeries.</li>
  <li>Opticians.</li>
  <li>Doctors & Dentists Surgeries.</li>
  <li>Hospital Wards.</li>
  <li>Laboratories.</li>
  <li>Customers and Products.</li>
</ol>
<p>The list is almost endless</p>
<h2>Company Overview</h2>
<p>Our philosophy has always been that the company is only as good as the staff it employs. Therefore we always strive to employ the right people for the job.</p>
<p>All of our staff are fully trained in what they do. Our installation engineers are qualified to handle refrigerants and have many years of experience in the air conditioning field. As a company we are accredited by the HVCA, Refcom and many of the leading air conditioning manufacturers including Daikin, Toshiba, Mitsubishi and Fujitsu. If required we can provide references and arrage site visits to see previous installations.</p>
<div align=&quot;center&quot;><img src=&quot;assets/images/logos.jpg&quot; width=&quot;530&quot; height=&quot;115&quot; usemap=&quot;#Map&quot; border=&quot;1&quot;> 
  <map name=&quot;Map&quot;>
    <area shape=&quot;rect&quot; coords=&quot;376,47,476,100&quot; href=&quot;[URL unfurl="true"]http://www.hvca.org.uk&quot;[/URL] target=&quot;_blank&quot;>
    <area shape=&quot;rect&quot; coords=&quot;233,49,296,111&quot; href=&quot;[URL unfurl="true"]http://www.daikin.com&quot;[/URL] target=&quot;_blank&quot;>
    <area shape=&quot;rect&quot; coords=&quot;7,45,204,100&quot; href=&quot;[URL unfurl="true"]http://www.toshiba-aircon.co.uk/&quot;[/URL] target=&quot;_blank&quot;>
    <area shape=&quot;rect&quot; coords=&quot;333,13,524,41&quot; href=&quot;[URL unfurl="true"]http://www.mrslim.co.uk/&quot;[/URL] target=&quot;_blank&quot;>
    <area shape=&quot;rect&quot; coords=&quot;229,2,320,50&quot; href=&quot;[URL unfurl="true"]http://uk.fujitsu.com/&quot;[/URL] target=&quot;_blank&quot;>
  </map>
  <div align=&quot;left&quot;><p>The works on site are supported by excellent office staff to ensure the smooth running of any job. The sales engineer who initially visits will be responsible from beginning to end of the project. Our engineers while on site are friendly and courteous at all times and are aware that their conduct reflects on the company as a whole.</p>
</div></div></body>
</html>

Anyone else spot something I have not? 

Thanks

Naiku
 
It's everything between the body { } part which is not working. Why do I get the feeling this is one of those times that no matter how hard you look you can't find what you are looking for and then someone comes along and spots it immediately......
 
make sure the content of your .css file contains only the CSS content and not <style></style> tags.

That could cause major problems. Gary Haran
 
Hi Naiku,

change

<body background=&quot;assets/images/center_cloud.jpg&quot;>
</head>
<body>


to

</head>
<body background=&quot;assets/images/center_cloud.jpg&quot;>

Erik
<!-- My sport: Boomerang throwing !!
This year I will participate at the World Championships in Germany. (!! Many Happy Returns !! -->
 
Thanks guys :) that fixed it. I did have the <style> and </style> tags in the CSS sheet. Definately deserved a star for the input. The page loads as I want it to now.

Thanks again

Naiku
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top