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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Having trouble with my background command in CSS 1

Status
Not open for further replies.

Goat23

Technical User
Jul 22, 2001
61
0
0
US
I'm having a problem with my CSS.

I've just recently started fooling around with CSS, and I have most everything set up the way I want it. However, my CSS comand for the background color is not working. Here's the code I'm using

<STYLE TYPE-"type/css">

<!--
BODY {background-color: #66ff66}
A:link {color: #99ff99}
A:visited {color: #99ff99}
H1 {font-size: 24pt; font-family: arial}
H2 {font-size: 22pt; font-family: arial}
H3 {font-size: 20pt; font-family: arial}
H4 {font-size: 16pt; font-family: arial}
H5 {font-size: 14pt; font-family: arial}
H6 {font-size: 12pt; font-family: arial}
P {font-size: 12pt; font-family:arial; color: #006600}
-->

</STYLE>


.....And here is how I have it arranged on my main page:

<HTML>
<HEAD>
<META HTTP-EQUIV="Expires" CONTENT="20030111">
<title>Famous Farms --- Producer of Fine Flora and Fauna</title>
<META NAME="keywords" CONTENT="Plants, Animals, Flora, Fauna, Famous, Farms, varieties, species, ">
<META NAME="description" CONTENT="A Provider of Fine Flora and Fauna">
<META NAME="Author" CONTENT="Greg Fahy">
<META NAME="Originator" CONTENT="Famous Farms">
<META NAME="Place.Keyword" CONTENT="Famous Farms">

<LINK REL=stylesheet HREF="/css.css" TYPE="text/css">
</HEAD>


<body topmargin="5" leftmargin="5">
<P> Welcome to Famous Farms.


</body>
</noframes>
</frameset>
</html>


....Please let me know if you spot where the problem is. You can also go to the site itself and look at the source code of the rest of the pages/frames, thanks.
 
You don't need the "<STYLE TYPE-"type/css"> <!--" stuff in your CSS file, you only need that for inline styles in an HTML document. Putting that stuff in a css file is invalid, and will make adjacent rules not work - the body {} rule in your case.

You can also replace the top/leftmargin attributes in your html with CSS equivalents:
Code:
body { background: #6f6;
       margin: 5px; }
And lose the [tt]</noframes> </frameset>[/tt] at the end, this isn't a frameset document.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Thanks, your post solved the problem.

Mucho Gracious
Greg

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top