Moderator
t-p
(@t-p)
I recommend asking at https://wordpress.org/support/theme/capri-lite so the theme’s developers and support community can help you with this.
Try this:
background-image: url('/link/to/logo.png');
background-size: contain;
background-repeat: no-repeat;
background-position: center;
Rather than adding this inline, you could conditionally apply this so it only affects smaller screens.
For reference:
contain: Scales the image as large as possible without cropping or stretching the image.
cover: Scales the image as large as possible without stretching the image. If the proportions of the image differ from the element, it is cropped either vertically or horizontally so that no empty space remains.
-
This reply was modified 6 years, 4 months ago by George Appiah. Reason: Added explanations of CSS COVER & CONTAIN
Hey there, George!
I’m sure that’ll fix it, but I had trouble adding it in the ‘Responsive’ section (I was trying to make it affect only on smaller screens). Any tips on how or where exactly to add the in the ‘Responsive’ section?
Cheers!
@paulamagaz,
Sorry for the delay. I’ve had this tab open in my Chrome browser for days, but I’ve been so busy here 🙂
The background image is added inline. So that makes it a bit tricky. Let’s first add:
.blog-entry-header {
background-repeat:none;
background-size: contain !important;
}
This will set the logo size to small for ALL screens. Though the use of !important
is generally not recommended, we need it in your case to override the inline style.
Now let’s restore the larger logo for larger screens only:
@media screen and (min-width: 992px) {
.home.blog .blog-entry-header {
background-size: cover !important;
}
}
Please note that I picked the 992px break out point from your stylesheet. Feel free to change this to a different breakout out point.
The “responsive section” you mentioned seems to be a feature of your theme — which I don’t have — so I’m not sure how that works.
But you can add the above CSS code snippets anywhere that you can add custom CSS code. Eg. in your child theme’s style.css
file, in your active theme’s custom CSS section in the dashboard (if any), in WordPress Customizer’s Additional CSS section (Appearance => Customize => Additional CSS
), in JetPack’s Custom CSS section, etc, etc, etc.
Kindly try it and let me know what happens — especially if the use of !important
creates any unintended effect.