Vertical alignment of text

  • Unknown's avatar

    I’m using “The Writer” theme, and I’m trying to change how the text is vertically aligned for each blog post’s thumbnail on the front page. When the home page is viewed in mobile mode, the title text for the blog post jumps to the top of the thumbnail. I’d like it to be on the bottom, but I can’t figure out how to refer to it in CSS. As far as I can determine, the class is called “post-title typography-title”, but nothing I enter into the CSS field seems to have an impact.

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hi heroofageneration,

    I changed the position and bottom for smaller sizes. You can try this code.

    @media only screen and (max-width: 660px), screen and (max-device-width: 660px)
    .post-list .book-cover .content {
        padding: 20px 20px 50px;
        position: absolute;
        bottom: 0px !important;
    }

    Let me know if this works for you. Thanks!

  • Unknown's avatar

    Hi joshron, I added the CSS and reviewed the site both on my desktop and smartphone, but unfortunately the title text is still in the same place; the code does not seem to have worked.

  • Unknown's avatar

    Hi heroofageneration,

    I see. Can you try changing position: absolute; to position: absolute !important;?

    Hope this helps. Thanks!

  • Unknown's avatar

    I noticed that with either version of the code, after I save the CSS and return to the CSS panel, the code as changed to:

    @media only screen and (max-width: 660px),screen and (max-device-width: 660px)
    .post-list .book-cover .content {
    
    }

    So I’m not sure if there’s something in your suggestion that’s not permitted by WordPress.

  • Hi
    This might just be a couple of missing braces.
    Try this:

    @media only screen and (max-width: 660px){
    .post-list .book-cover .content {
        padding: 20px 20px 50px;
        position: absolute;
        bottom: 0px !important;
    }
    }
  • Unknown's avatar

    Now it works! Thank you both so much, I really appreciate it!

  • Unknown's avatar

    That’s great! Thanks for the help @mouli!

  • The topic ‘Vertical alignment of text’ is closed to new replies.