By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,255 Members | 1,701 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,255 IT Pros & Developers. It's quick & easy.

Why won't my style sheet work?

P: 2
I need help with my css style sheet. I have be trying to follow these tutorials online and I feel I have followed their instructions to a "t". The problem I am having is the browser won't recognize my style sheet. Below is how I have everything set up. Thanks for your help, I am new at all of this.

Example:(File saved as index.html on notepad)

html>
<head>
<title>my first go at css</title>

<link rel="stylesheet" href="C:\Users\owner\Desktop\site files\style.css" type="text/css">
</head>

<body>
<h1>Thhis is a header</h1>

<p>This is a paragraph</p>



</body>
</html>

Example:(File saved as style.css and is in the same folder on my desktop as my file, index.html)

h1 {

color: blue;

}

(So why won't the simple header turn blue when I refresh my page in Google Chrome?)
May 5 '12 #1
Share this Question
Share on Google+
2 Replies


harshmaul
Expert 100+
P: 490
A few things to check.
Is the css file called style.css, and not style.css.txt
You can confirm this by forcing windows to show extensions
Link to do that here

next use this link tag instead,
<link rel="stylesheet" href="style.css" type="text/css">

Let me know if you are still having problems
May 14 '12 #2

P: 2
Thanks for your reply. I went ahead and took the easy way out and downloaded Kompozer to give me some training wheels to work with. I am still having problems with unwanted space between my image and the cell I have the image in......Code is below if you feel like helping me out with this one. I have been trying to figure out how to eliminate the space all day, but I have been unsuccessful at my attempts. I am sure it is something easy and dumb but I just can't see what it is.


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>small business marketing services | marketing comapnies</title>
</head>
<body
style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"
alink="#000099" link="white" vlink="#990099">
<table
style="width: 800px; text-align: left; margin-left: auto; margin-right: auto;"
border="0" cellspacing="0">
<tbody>
<tr>
<td colspan="6"
style="background-color: rgb(0, 96, 192); height: 24px; width: 888px; text-align: center; vertical-align: middle;"></td>
</tr>
<tr>
<td colspan="6"
style="height: 285px; width: 888px; text-align: left; vertical-align: middle;"><img
style="width: 888px; height: 277px;"
alt="Contact us for a free marketing consultation by calling 303-351-2434."
src="file:///C:/Users/owner/Desktop/site/images/marketing.gif"></td>
</tr>
<tr>
<td
style="height: 24px; width: 143px; text-align: center; vertical-align: middle; background-color: rgb(0, 96, 192);"><a
href="index.html">Home</a></td>
<td
style="height: 24px; width: 143px; text-align: center; vertical-align: middle; background-color: rgb(0, 96, 192);"><a
href="aboutus.html">About Us</a></td>
<td
style="height: 24px; width: 143px; text-align: center; vertical-align: middle; background-color: rgb(0, 96, 192);"><a
href="services.html">Services</a></td>
<td
style="height: 24px; width: 143px; text-align: center; vertical-align: middle; background-color: rgb(0, 96, 192);"><a
href="faq.html">FAQ</a></td>
<td
style="height: 24px; width: 143px; text-align: center; vertical-align: middle; background-color: rgb(0, 96, 192);"><a
href="contact.html">Contact Us</a></td>
<td
style="height: 24px; width: 143px; text-align: center; vertical-align: middle; background-color: rgb(0, 96, 192);"><a
href="casestudies.html">Case Studies</a></td>
</tr>
<tr>
<td style="height: 350px; width: 888px;" colspan="6"><br>
<br>
<h4><span style="font-family: Arial;"></span></h4>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;</p>
</td>
</tr>
<tr>
<td style="height: 0px;" colspan="6"></td>
</tr>
<tr align="center">
<td colspan="6"><span style="font-family: Arial;">Created
by FOCUS Consulting Group, LLC. 2012 All Rights Reserved.</span></td>
</tr>
</tbody>
</table>
<br>
</body>
</html>
May 15 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.