SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: CSS Question

  1. #1
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS Question

    I have an image that is in the center of my webpage, and it works there. However, I want an image/color to be on the actual background of my site without interfering with the image in the center. How would I do this?

    This is my code:

    Code:
    body{
    	background: url(images/greenBackground.png) center no-repeat;
    
    }
    #header{
    	background: url(images/gogreenLogo.png) center top no-repeat;
    	margin-left:182px;
    	width:287px; 
    	height:138px;
    }

  2. #2
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fixed that issue; How would I put another background image behind the image that is in the center?

  3. #3
    SitePoint Wizard donboe's Avatar
    Join Date
    Jun 2010
    Location
    Netherlands
    Posts
    2,105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Since you already have a image as background on the body I suggest you use an extra div width: 100%; height:100% and have a background image for that div as well.

  4. #4
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Its appearing in front of that image, not as the actual background itself.

  5. #5
    SitePoint Zealot materialdesigner's Avatar
    Join Date
    Dec 2010
    Location
    Ithaca, NY
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you give us your current HTML and CSS?

    The centered image should be in your inner div, your background image or color should be on your outer div.

    Alternatively, if you would like to use CSS3 (not supported in all browsers), you can specify multiple backgrounds on one div.

  6. #6
    SitePoint Wizard donboe's Avatar
    Join Date
    Jun 2010
    Location
    Netherlands
    Posts
    2,105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by materialdesigner View Post
    Alternatively, if you would like to use CSS3 (not supported in all browsers), you can specify multiple backgrounds on one div.
    Yeah, it would be nice if every browser would support that, indeed.

    @boboreo like materialdesigner already said, a link to your side would be very helpful. Or a link to a site where you maybe have seen the layout you would like to have.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •