Category template style 8: fitting the image in the container

Posted in: Newspaper
Post count: 2

Is it possible to fit the background-image of a categorypage in the container (outlined with red)?

So I don’t want the size of the image be affected by the screen resolution. Rather I want it to be fixed and fitted in the container. Any ideas?

Screenshot of category page

  • This topic was modified 10 years by Halil.
Post count: 22421

Hello,
I assume you use the category style 6. There is no option for this in the theme but you can do it with a bit of css. You will first need the category id so we can target just one cat. at a time. You can get the category id like so: http://screencast.com/t/c8iyl0MFKvos
Then you can use the id as a css class and add your background image via an URL like so:
.category-199 .td-category-title-holder{
background-image: url("http://i.huffpost.com/gen/2125210/images/o-EYES-facebook.jpg");
background-size: 100%;
background-position-y: -90px;
}

Result: http://screencast.com/t/JrCL5Y9fIT
If you want to use this method on another category simply change the category id and the image
I hope this helps.
Thank you!

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