Sign in with
Sign up | Sign in
Your question

Why my content isn't getting the background?

Last response: in Applications
Share
June 15, 2012 10:45:26 AM

I'm making a simple website and I got a background image for the content part of the site but it won't print out to my screen when I view the site.
I have 1 big div-element that holds 2 smaller div-elements inside itself (2 columns). The divs that are inside the bigger one will just use the default background-color (dark blue) and not show the white image.

My CSS:
  1. body{
  2. margin: 0;
  3. padding: 0;
  4. background-color: #0e5181;
  5. }
  6.  
  7. #wrapper {
  8. width: 1000px;
  9. margin: 0 auto;
  10. }
  11.  
  12. #logo {
  13. background-image: url('../kuvat/logo.gif');
  14. height: 130px;
  15. width: 1000px;
  16. }
  17.  
  18. #content {
  19. background-image: url('../kuvat/keski.gif');
  20. background-color: #fff;
  21. margin: 0 auto;
  22. }
  23.  
  24. #valikko {
  25. width: 150px;
  26. float: left;
  27. }
  28.  
  29. #sisalto {
  30. width: 850px;
  31. float: right;
  32. }
  33.  
  34. #footer {
  35. background-image: url('../kuvat/footer.gif');
  36. width: 1000px;
  37. height: 43px;
  38. clear: both;
  39. }
  40.  
  41. #footer p {
  42. text-align: center;
  43. }


and my index.html:
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fi" lang="fi">
  4. <head>
  5. <title>Cool Card</title>
  6. <link rel="stylesheet" type="text/css" href="css/tyyli.css" />
  7. </head>
  8.  
  9. <body>
  10. <div id="wrapper">
  11. <div id="logo">
  12. </div>
  13. <div id="content">
  14. <div id="valikko">
  15. <a href="#">LINK</a>
  16. </div>
  17.  
  18. <div id="sisalto">
  19. *MAIN CONTENT HERE*
  20. </div>
  21. </div>
  22.  
  23. <div id="footer">
  24. <p>Copyright © 1999-2012 Cool Card</p>
  25. </div>
  26. </div>
  27. </body>
  28. </html>

More about : content background

June 15, 2012 10:20:39 PM

Do any of the images show up? If not, try referencing them with the absolute path, and not the relative path
!