Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Website Design
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 05-10-2009, 08:56 PM   #1
Warrior Member
 
Join Date: May 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default What is the exact css code to put a background behind a centered div tag?

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.

pzqwpo is offline   Reply With Quote
Old 05-10-2009, 11:23 PM   #2
Senior Warrior Member
War Room Member
 
Karen Blundell's Avatar
 
Join Date: Jul 2008
Location: Niagara Region, Canada
Posts: 1,113
Thanks: 1,478
Thanked 412 Times in 322 Posts
Social Networking View Member's Twitter Profile  View Member's YouTube Profile
Contact Info
Send a message via Skype™ to Karen Blundell
Default Re: What is the exact css code to put a background behind a centered div tag?

add this to your css stylesheet

Code:
body { background: #cccccc; }

Karen Blundell is offline   Reply With Quote
Old 05-11-2009, 02:28 PM   #3
Warrior Member
 
Join Date: Mar 2009
Posts: 28
Thanks: 2
Thanked 3 Times in 3 Posts
Default Re: What is the exact css code to put a background behind a centered div tag?

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>

Geejayz is offline   Reply With Quote
Old 05-11-2009, 02:35 PM   #4
c/l:i\c.k{m}o^n'k[e]y
War Room Member
 
ClickMonkey's Avatar
 
Join Date: Nov 2006
Location: On the Internet relentlessly doing work so you can make more money and have more time for fun! :-)
Posts: 30
Thanks: 16
Thanked 10 Times in 8 Posts
Default Re: What is the exact css code to put a background behind a centered div tag?

Hello! :-) The suggestions that have already been provided
will probably work perfectly for you. If for some strange reason
they do not, one other approach you can try is to include the
style data within the div tag itself...

Code:
<div style="background: #cccccc;"> </div>
Anyway, hopefully you'll find some of these responses useful.
ClickMonkey is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Website Design

Tags
background, centered, code, css, div, exact, put, tag

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 08:55 PM.