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

trouble w/css background image

Status
Not open for further replies.

bitterpants

Programmer
Sep 13, 2002
9
0
0
US
im having trouble making a background image appear on my page using an external CSS file.


heres my css:

body {
background-color: #cccccc;
color: #333333;
font-family: arial, helvetica, sans-serif;
font-size: 11px;
margin: 6px 6px 6px 6px;
padding: 0px 0px 0px 0px;
}

h3 {
font-family: arial, helvetica, sans-serif;
font-size: 14px;
font-weight: bold;
}

img {
border-width: 0px 0px 0px 0px;
padding-top: 0px;
padding-bottom: 8px;
}

#main {
background-image: url(BWILDlogo-bg.gif);
background-position: 15px 15px;
}

#main #text {
width: 225;
float: left;
position: relative;
top: 10;
margin-top: 20px;
}

#main #pic {
float: left;
padding-left: 20px;
}



and heres my html:

<body>

<div id=&quot;head&quot;>
<img src=&quot;Blogo.gif&quot; width=&quot;136&quot; height=&quot;38&quot; alt=&quot;B&quot;>
<h3>Permanent Color</h3>
</div>

<div id=&quot;main&quot;>
<div id=&quot;text&quot;><p>This is a bunch of text about that stuff. IGive Me Content!</p>
<p>Colors:<br>
Fire Red<br>
Jet Black<br>
Burgundy<br>
Dark Plum</p></div>
<div id=&quot;pic&quot;><img src=&quot;bwildphc.jpg&quot; alt=&quot;Permanent Hair Color&quot;></div>
</div>

</body>
 
that doesnt do it either. 'url(path-to-file)' is the syntax for CSS. there is not a way to use a background image w/out that syntax.
 
not sure what you mean exactly, but yes,

background-image: url(filename.ext);

is the correct way to specify a background image, but there is something else w/the css or maybe the html that makes it not work. any ideas?
 
ahhh in my haste i failed to realize You have 3 instances of #main!!! [soapbox]
sleep is good
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top