This topic has 13 replies, 2 voices, and was last updated 9 years by sharmstr.

  • Author
  • #69819
     ghodson
    Participant

    I 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.

    #69820
     ghodson
    Participant
    This reply has been set as private.
    #70005
     sharmstr
    Moderator

    Seems 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 solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #70006
     sharmstr
    Moderator
    This reply has been set as private.
    #70244
     ghodson
    Participant

    Thanks 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.

    #70248
     sharmstr
    Moderator

    The 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 solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #71333
     ghodson
    Participant
    This reply has been set as private.
    #71360
     sharmstr
    Moderator
    This reply has been set as private.
    #74821
     ghodson
    Participant
    This reply has been set as private.
    #74844
     sharmstr
    Moderator

    Technically, 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 solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #75331
     ghodson
    Participant

    I’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.

    #75343
     sharmstr
    Moderator

    put .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 solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #75344
     ghodson
    Participant
    This reply has been set as private.
    #75349
     sharmstr
    Moderator
    This reply has been set as private.
Viewing 14 posts - 1 through 14 (of 14 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?