Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

moving stuff around

So i am trying to move the background around for the #head but not move the logo...should i make a different div? and if i do that how to i bring my logo to the front of the bg div?

    body {
    font-family: 'Nunito', sans-serif;
    color: #000000;
    background: #ffffff url('img/bg-texture.jpg') repeat;
}



#logo {

}


#head {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    background: #331818;
    position: absolute;
    top: 0;
    left: 0;
}




#About-us {
    color: #b22316;
    font-weight: 600;
    margin: 300px 0px 0 450px ;
    background: #ddb47e;

}



#contact-us {
    color: #b22316;
    font-weight: 600;
    margin: 0 0 0 450px ;

}

#address {

}



#Twitter {
    margin: 0 0 0 800px ;
}



#copyright {
    border-top: 1px solid #2a0400;
    padding: 10px 0;
    margin: 15px 0;
    text-align: center;
}

2 Answers

I do no know exactly what you are trying to accomplish, but the idea would be to put some sort of wrapper div around your logo, and give that wrapper div a background, whether it be an image, gradient, etc. Then depending on what you are using, you can use the background-position to move it around. This will help ensure your background stays a background, and your logo stays in the foreground, without adding extra markup and messing around with z-index's, which can get hairy.

Some clarity might help, I'd suggest you start a new pen on Codepen.io, and if you need more help, save it and post that link here. Than we can all see your code and help make edits.

+1 for the codepen suggestion

thank you for your reply. I will do that