CSS Code for Non-Stretch, Fixed Background Image on Homepage Only

Posted in: Newspaper
Post count: 3

Hi,

I want a background image to show only on the homepage of my site, and not any other pages. I found some CSS code in the forums to do this, but it only works if the background image is in stretch mode.

Is there a custom CSS code I can use for fixed images that aren’t stretched to have the background image show up on the homepage only? If not, is there any other way I can have the background image only show up on the homepage?

Thank you in advance for your help!

Post count: 23312

Hello BenBee,

You should use the background-image property and add it to your homepage, like this ->

.home {
background-image:url(http://demo.tagdiv.com/newspaper/wp-content/uploads/2016/05/login-mod.jpg);
background-size:100% 100%;
background-repeat: no-repeat;
}

Use HD images if you want to achieve best theme results.

Thanks for your message!

Post count: 3

Thank you for the reply! I gave that a try and it seemed to make the image I’m using smaller and put it behind the main section of the website.

I’m not sure if it has something to do with ads, but what I’d like to do is have a background image ad on the homepage only and not on any other page. For posts and categories I was able to get around this by putting custom backgrounds for each category. It’s still clickable but there is no image so that is ok. The problem I’m running into is that for other pages like my about page, contact page, and the link, the background image is still showing up.

Maybe there is another way to accomplish what I’m looking for without CSS? My website is todaysrdh.com if you want to take a look. If you go to todaysrdh.com/about you will see the background image that I’m trying to remove. (I want it removed from all pages, not just the about page, but that’s an example.)

Thank you in advance for your help — I very much appreciate the support you provide!

Thanks,
Ben

Post count: 23312

Hello BenBee,

Sorry but as you want to do involves more custom work through the code which is not covered by our support policy, sorry! If you want other options compared to existing ones you should implement it yourself because we cannot provide this kind of services, sorry!

Thanks for your message!

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.