What is the exact css code to put a background behind a centered div tag?

by pzqwpo
2 replies
  • WEB DESIGN
  • |
I want to center my website and behind the centered div tag i want to have a plain gray background but i can't seem to get any codes to work.

Please give me the exact codes and where to put them...i dont know if i should put it in a css or right in the page code.
#background #centered #code #css #div #exact #put #tag
  • Profile picture of the author Karen Blundell
    add this to your css stylesheet

    Code:
    body { background: #cccccc; }
    Signature
    ---------------
    {{ DiscussionBoard.errors[772792].message }}
  • Profile picture of the author Geejayz
    If you just want the background within the div container then css would be similar to above eg:

    styles.css
    Code:
    #bgstyle {
     background: #cccfff;
     }
    mypage.html
    Code:
    <div id = "bgstyle">
    <p> this is within the div tag </p>
    </div>
    {{ DiscussionBoard.errors[774800].message }}

Trending Topics