View Full Version : HTML background image not showing (a bit of CSS, too)


Neurologist
03-18-2005, 10:56 PM
Someone please tell me what I'm doing wrong.




<HTML>
<head>
<LINK href="style.css" rel="stylesheet" type="text/css">
<title>|||||||||||SECRETKIWI|||||||||||||||||Portfolio, graphic and web design</title>
<META NAME="keywords" content="web, graphic, graphics, design, web design, graphic, graphic design, kiwi, secret, secret kiwi, portfolio, Kat, Durrett, Kat Durrett, Anne, billing, HTML help, HTML, Photoshop, Adobe, CS, 6.0, 7.0">
<META NAME="description" content="Secret kiwi : Kat Durrett's porfolio, web design and graphic design for reasonable prices.">
</head>
<body>
<body style="overflow-x:hidden">
<body background="back1.jpg">
<div id=layer1 style="position:absolute; top:0; left:0; width: 200px; ">
<img src="layout1.jpg">
</div>



and for a moment, I thought my CSS was contradicting it. But I have no background specified in the CSS.



<style type="text/css">

A:link
{ text-decoration: underline; color:#5F6323; }
A:visited
{ text-decoration: underline; color:#5F6323; }
A:active
{ text-decoration: underline; color:#5F6323; }
A:hover
{ text-decoration: underline; color:#5F6323;
background-color: #5F6323;}


h1 {font-family: times new roman;
color: #000000 ;
letter-spacing: 3pt;
font-size: x-small;}

p {font-family: times new roman;
color: #000000 ;
letter-spacing: 3pt;
font-size: x-small;}

body
{ background: #9AA139;

font-family: times new roman;
color: #000000 ;
letter-spacing: 3pt;
font-size: x-small;

scrollbar-face-color : #9AA139;
scrollbar-highlight-color : #C5CF42;
scrollbar-3dlight-color : #ffffff;
scrollbar-shadow-color : #83892E;
scrollbar-darkshadow-color : #53571F;
scrollbar-track-color : #000000;
scrollbar-arrow-color : #000000;
}

td
{
font-family: times new roman;
color: #000000 ;
letter-spacing: 3pt;
font-size: x-small; }

input, textarea
{ background: #9AA139;
font-family: times new roman;
color: #000000 ;
letter-spacing: 3pt;
font-size: x-small;}

</style>

Dude128
03-18-2005, 11:07 PM
you have two body tags, so you should combine them into one, and the CSS should be in the head section.

also, why use the background attribute AND CSS in the body tag, when they could just be added to your main style sheet?

Neurologist
03-18-2005, 11:16 PM
A: I combined, no such luck.

B: I didn't put it in my main style sheet because the index of the site will have a different background, and the rest of the pages, I just want it to be a background color.

C: Another question, I know the CSS should be in the head tag, but I have a style.css. Do you add the "<style type="text/css">" within your main style sheet, or not? It seems like you wouldn't have to considering the file is .css afterall, but I figured I should check.

Dude128
03-18-2005, 11:22 PM
oops, didn't realize it was a separate file. I was thinking that was all in one file like that- now it makes more sense, I was wondering why you used a combination of CSS, HTML, and CSS again :P

nope, you shouldn't have the <style ...> and everything in the .css file.

I would think combining the tags might help- unless the background color specified in the CSS is overriding the HTML. something else you could try is using CSS within the head tag to specify the background, like how you did the overflow.