Login | Register | FAQ
Anonymous

background color behind a container?

+ Post a reply

5 posts Page 1 of 1


background color behind a container?

by Edward123 » Mon Nov 07, 2011 9:31 pm

hi

My site has a container that is 980px wide, i can set the background image as i want it in the body, in the header and in the footer.

What I cannot do is set the color behind the container? There are lots of people asking this on other forums and some pretty stupid answers from people who are no understanding the question. Some people are calling the area outside the container, wrapper/wrapping and also seen someone advise on using a keyword "Expose"

any ideas?
Edward
User avatar

Edward123

  • Posts: 89
  • Joined: Wed Oct 05, 2011 7:57 pm

Re: background color behind a container?

by atik » Tue Nov 08, 2011 5:12 pm

I am not sure what you are looking for but you can use this style in your css.
Code: Select all
   #content {
background-color: #FFFFFF;
background-image: url(tick.gif);
background-repeat: no-repeat;
background-position: bottom right;
background-attachment: scroll;
}


Another thing is that if you want to use background color behind an image then at first make sure the background of the image is transparent and you must save the image as png24 by your image editor like photoshop.
If you don't get your answer yet, please write the full description with code so it will be easier for us to understand your problem.
User avatar

atik

  • Posts: 472
  • Joined: Mon Oct 17, 2011 4:55 pm

Re: background color behind a container?

by Edward123 » Tue Nov 08, 2011 10:11 pm

Hi
Using a #body{ } in my css above the #container and in the head section of my html has worked!
Sorry for not posting code, my pc had a horrible trojan called "system restore" and i could not acess any of my files but i have finally got rid!
Edward
User avatar

Edward123

  • Posts: 89
  • Joined: Wed Oct 05, 2011 7:57 pm

Re: background color behind a container?

by Edward123 » Wed Nov 09, 2011 12:26 am

Hi Cubesquare

Which part of the code would you like me to post?

Funny you should say that about system restore, i had to do one to get rid of the trojan. But thankfully all my updated pages were stored online so i could transfer them from there!

I will be sure to start putting my code on posts now that i can acess them all

Edward
User avatar

Edward123

  • Posts: 89
  • Joined: Wed Oct 05, 2011 7:57 pm

Re: background color behind a container?

by Edward123 » Wed Nov 09, 2011 12:02 pm

Hi CubeSquare

No problem

In my CSS Sytlesheet is this:

#content {
background-image: url("images/blackfade.jpg");
}

#container {
width: 980px;
min-height: 100%;
position: relative;
margin-left: auto;
margin-right: auto;
margin-top: -8px;
}

#header {
width: 980px;
height: 100px;
position: relative;
}

#body {
position: relative;
width: 980px;
height: 500px;
}

#footer {
position: relative;
width: 980px;
height: 15px;
margin-left: auto;
margin-right: auto;
margin-top: -8px;
background-color: white;
padding-top: 10px;
}

and then in my html documents i put this into the <head> section of every page:

body {
background-image: url("images/blackfade.jpg");
background-repeat: no-repeat;
background-size: cover;
}

and that gets the background of my page how i wanted it in my head, i think that my containers, header body and footer are all just see through and then the body of the actual page is my "blackfade" image, or as i called it the area behind the container.

Edward
User avatar

Edward123

  • Posts: 89
  • Joined: Wed Oct 05, 2011 7:57 pm


+ Post a reply

Page 1 of 1

?>