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

Odd BG Image behavior

Status
Not open for further replies.

TheConeHead

Programmer
Aug 14, 2002
2,106
US
I am trying to give a div a bg image but it seems to be applying it to the body... any reason why?

Code:
<div style="padding-left:150px; width:698px; height:534px; background-image: url(images/bg.jpg); background-repeat: no-repeat;">

</div>

[conehead]
 
works fine for me. what seems to be the problem?

*cLFlaVA
----------------------------
[tt]insert funny quotation here.[/tt]
 
as I said, the bg image is getting applied to the body and not the div....

[conehead]
 
This applies correct background images to correct elements for me in IE6, Mozilla and Opera 7+.
Code:
<html>
 <head>
  <style>
   body {
	background: url(pic1.jpg);
   }
  </style>
 </head>
 <body>
   <div style="padding-left:150px; width:698px; height:534px; background-image: url(pic2.jpg); background-repeat: no-repeat;">
   </div>
 </body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top