background image for each page

Joined
May 11, 2016
Messages
1
Reaction score
0
Im having trouble adding a new background image for each webpage. Most content is repeatative except background image.

Code:
body
{
    margin:0; padding:0;  background-image:url('backgrounds/background.nyc.jpg'); background-size: cover; 
    font-family: Tahoma;
}

I just want a new background image for each webpage instead of using more than one stylesheet
 
Joined
May 8, 2016
Messages
4
Reaction score
0
Hi,

Create separate classes for the bg and add it to the body tag.

Code:
.home-bg { background: url(images/home-bg.jpg) no-repeat center center fixed; }
.about-bg { background: url(images/about.bg.jpg) no-repeat center center fixed; }

HTML:
<html>
    <body class="home-bg">
    </body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top