3 Replies - 498 Views - Last Post: 06 December 2012 - 05:52 AM

#1 BrentisHere  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 18-October 12

background image isn't loading CSS

Posted 05 December 2012 - 01:49 AM

Hey,

I sliced up my photoshop document and everything is good with that...but, currently my css isn't displaying my background...I have a background image that I want to repeat x and y....
Here's the Code I have
.container {
width: 800px;
margin: 0 auto;
}
body, div, h1, h2, h3, h4, h5, h6, p, ul, img {
margin:0px; 
padding:0px; 
}  

    url (images/background.jpg)  
	    #main {  
        background: url(images/background.jpg) repeat-x;  
    }  


Now... why isn't it doing it? I mean...everything is fine on the html side :|
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
	<body>
	<div id="main">
	<div class="container">
	<!-- content goes here -->
	<div id="header">
	<div id="logo">
	<h1>Logo</h1>
	</div>
	<div id="tagline">
	<h3>And a little tagline, too.</h3>
	</div>
	
	</div> <!-- END HEADER -->
	<div id="content">
	<img src="image/contentbox.jpg" alt="MISSING">
	</div><!-- END CONTENT -->
	<div id="navbar">
	</div><!-- End Navbar -->
	<ul id="menu">
	<li><a href="">Home</a></li>
	<li><a href="">blurgh</a></li>
	<li><a href="">blurghhhhh</a></li>
	<li><a href="">heyyy</a></li>
	</ul>
	</div><!-- END CONTAINER -->
	</div><!-- END MAIN -->
	<div id="footer">
	<div class="container">
	</div><!-- END FOOTER CONTAINER -->
	</div><!-- END FOOTER -->
	
	</body>


Just not really understanding...

Is This A Good Question/Topic? 0
  • +

Replies To: background image isn't loading CSS

#2 Anthonidas  Icon User is offline

  • D.I.C Head

Reputation: 30
  • View blog
  • Posts: 218
  • Joined: 25-April 11

Re: background image isn't loading CSS

Posted 05 December 2012 - 02:18 AM

you have not defined a width and a height for your #main div. you should say for example, that it is 100% in width and height, or otherwise set your background to the body-tag instead of your #main div.

which class or id does your "url (images/background.jpg) " belong to?!?!
Was This Post Helpful? 0
  • +
  • -

#3 BrentisHere  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 18-October 12

Re: background image isn't loading CSS

Posted 05 December 2012 - 06:49 PM

Thankyou for explaining! I really didn't want code though. I was more wanting on the lines of..."Think about it this way...you have your website, you have your background, are the two linking, have you set the CSS out correctly, double check." Thanks though.
Was This Post Helpful? 0
  • +
  • -

#4 Anthonidas  Icon User is offline

  • D.I.C Head

Reputation: 30
  • View blog
  • Posts: 218
  • Joined: 25-April 11

Re: background image isn't loading CSS

Posted 06 December 2012 - 05:52 AM

i have tested your script, and as said in my previous post: line 10 of your CSS code is wrong and can't be handled. so everything that comes after this line 10 is not working. comment it and you will soon see the effect.

and secondly, as said in my prev. post, you have to define at least a height for your main div. otherwise your background will be visible only for the heght of your container, and not the whole document size.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1