-
Author
Tagged: responsive background image
-
July 24, 2015 at 16:53 #69819
ghodson
ParticipantI have placed a background image in the title area of my blog archive page.
I want to make this iamge responsive. The issue is that it is using padding to adjust size of container.July 25, 2015 at 20:58 #70005sharmstr
ModeratorSeems like something like this would serve you better
.main-title {
content: url(“http://yoursite.com/wp-content/uploads/2014/02/xxxx-blog2.jpg”);
height: auto;
width: 100%;
padding-top: 0;
padding-bottom: 0;
}Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJuly 25, 2015 at 20:59 #70006sharmstr
ModeratorPrivate reply so I can give you the full css with your site name 🙂
COPY CODE.main-title { content: url("http://lssbei.com/wp-content/uploads/2014/02/lssbei-blog2.jpg"); height: auto; width: 100%; padding-top: 0; padding-bottom: 0; }Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJuly 27, 2015 at 16:07 #70244ghodson
ParticipantThanks the only problem with this is that the container has no height if padding is removed. I.e you can only see a thin strip about 40px. I want to show around 300px in height and have it resize to about 150px on mobile if you get what I mean.
July 27, 2015 at 16:17 #70248sharmstr
ModeratorThe code works fine on my site. Did you remove background image from theme options first? http://dev.sharmstr.com/testing-again/
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionAugust 3, 2015 at 16:17 #71333ghodson
ParticipantYes. Take a look at my site. when using your code, I can’t see the image.
Login Details in case you need:username: tangible
Password: Solution4$3$2$1$August 3, 2015 at 17:19 #71360sharmstr
ModeratorBut I see it just fine. And it scales.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionAugust 27, 2015 at 11:32 #74821ghodson
ParticipantHi There
After recent update, I can no longer see this image again. (although it seems to be just firefox that is having the issue). Can you please check for me.
Thanks
August 27, 2015 at 15:11 #74844sharmstr
ModeratorTechnically, the content element needs to be attached to a ::before or ::after pseudo element. Chrome apparently doesnt care, but firefox does. Add css for the ::before pseudo element
.main-title::before
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionAugust 30, 2015 at 05:46 #75331ghodson
ParticipantI’ve just noticed that this fix won’t work because it places the image on other pages, when it should only be on the blog archive page.
August 30, 2015 at 14:45 #75343sharmstr
Moderatorput .blog in front of it.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionAugust 30, 2015 at 15:07 #75344ghodson
ParticipantI tried, but now I just get grey area, no image.
This is what I have:body.blog h1.page-title { display:none; }
body.blog .page-info { visibility:hidden; }.blog.main-title::before{
content: url(“http://lssbei.com/wp-content/uploads/2015/08/LSSBEI-Blog.jpg”) !important;
height: auto !important;
width: 100% !important;
padding-top: 0 !important;
padding-bottom: 0 !important;
}August 30, 2015 at 16:02 #75349sharmstr
ModeratorYou need a space between .blog and .main-title since they are different divs 🙂
COPY CODE.blog .main-title .container { display: none; } .blog .main-title { height: auto !important; padding-top: 0 !important; padding-bottom: 0 !important; border-bottom: 0; } .blog .main-title::before { content: url("http://lssbei.com/wp-content/uploads/2014/02/lssbei-blog2.jpg") !important; }Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.