Hi,
I am right at the beginning of my web design "career"! I am reading "Build you own Website the right way using HTML and CSS", and following the instructions to build a sample site. But something isn't quite right. I have 3 pages written in html, which look as they should with IE. But now I am adding a CSS page. I have this copied exactly from the book, and saved in the same file as the other 3 pages. I have put a link, again copied axactly from the book, into the 3 pages of HTML. I have checked the links and code several times. But the CSS instructions eg for Font and colour, are not being followed. The CSS page doesn't appear to be linked to the HTML pages. I have followed the instructions in the book, to "force Reload" the pages, to avoid caching problems, and it made no difference. Also the photo that I have tried to put into the HTml page isn't showing up, just a frame where it should be, even though it is also saved in the same file. I am doing all this offline. What am I doing wrong?
Thanks
What i usually Do is use all my CSS Inline with my html untill i am ready to put it up on the Server.
Its just easier that way. I can help you Much More if you Gave us a Link to See this example site.
Or by posting the html & CSS in the thread.
Blake Tallos - Software Engineer for Sanctuary
Software Studio, Inc. C# - Fanatic! http://www.sancsoft.com/
CSS code as follows:
/*
CSS for chocoholics anon
/*
body {
font-family: Verdana, Helvetica, Arial, sans-serif;
background-color: cc9966;
padding: 15px;
line-height: 125%;
}
HTML code :
(Doctype etc missing as forum wouldn't let W3 links be posted)
<head>
<title>ChocaholicsAnon - Are you addicted to Chocolate?</title>
<meta http-equiv="Content-type" content="text/html; charset=utf - 8" />
<link href="style1.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id= "header">
<div id="sitebranding">
<h1>ChocaholicsAnon - Are you addicted to Chocolate?</h1>
</div>
<div id="tagline">
<p> Come and join us! A community with all Chocolate resources in one place.</p>
</div>
</div> <!-- end of header div-->
<div id="navigation">
<ul>
(NAVIGATION REMOVE FOR FORUM PURPOSES)
</ul>
</div> <!-- end of navigation div -->
<div id="bodycontent">
<h2>Do you have a passion for Chocolate? </h2>
<p><img src="Fotolia_6603249_XSpouringchoc.jpg" width ="283" height="424"
alt="pouring melted chocolate" /></p>
<p>At Chocaholicsanon you will not be alone. Here, you can buy a special gift, share a favourite chocolate recipe, or discover the history of chocolate. Want to know more about FairTrade chocolate? Then check out our Fair Trade page. Looking to join the 70% club? Read more about it here. Or do you just want a decent chocolate cake recipe? We have that too!</p>
</div> <! -- end of bodycontent div -->
</body>
</html>
Last edited by Auspom; Oct 23, 2008 at 00:58.
Reason: typo
There is no rule in your css that says that the color of the font should be changed.
The only rule to change colors is the one for the background. Also for the color of your background you should add the # in front. (Just to follow standards)
If you want to change the color of the font then you need to add the following css rule
Bookmarks