• Resolved billblast104

    (@billblast104)


    I want to align my post heading center and I added this CSS:

    header h1.entry-title {
    text-align: center;
    font-weight: bold !important;
    }

    It worked initially but when I added more CSS afterward it went to default and aligned to the left. Should I just re-add the CSS?

    The page I need help with: [log in to see the link]

Viewing 12 replies - 1 through 12 (of 12 total)
  • Leo

    (@leohsiang)

    Hi there,

    It’s likely that the new CSS you’ve added has some syntax errors which stops the CSS below the error from executing.

    You can use a service like this to check: https://jigsaw.w3.org/css-validator/

    Hope this helps!

    Thread Starter billblast104

    (@billblast104)

    @leohsiang I don’t have a clue at exactly what I’m looking at…lol I got the CSS from a post in here while looking for the alignment issue. It listed 9 warnings. This is the link that was generated when I put in the CSS starting right after the CSS in my post:

    http://jigsaw.w3.org/css-validator/validator$link

    Leo

    (@leohsiang)

    You need to make sure things like every line has a ; to close and all { has a } to go with.

    Thread Starter billblast104

    (@billblast104)

    Ok Leo let me see if I can figure this out…thanks a million

    Thread Starter billblast104

    (@billblast104)

    It seems to me that line has what it’s supposed to have:

    header h1.entry-title {
    text-align: center;
    font-weight: bold !important;
    }

    .inside-header {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    }

    .site-logo {
    -webkit-box-ordinal-group: 2;
    -ms-flex-order: 1;
    order: 1;
    }

    .site-branding {
    -webkit-box-ordinal-group: 3;
    -ms-flex-order: 2;
    order: 2;
    }

    .site-header {
    position: sticky;
    top: 0;
    }

    #site-navigation {
    position: sticky;
    top: 165px;
    }

    @media (max-width: 768px) {
    .site-header,
    #site-navigation {
    position: relative;
    top: auto;
    }
    }

    Leo

    (@leohsiang)

    I can see the code working:
    https://www.screencast.com/t/sx8FhvLM

    Thread Starter billblast104

    (@billblast104)

    I see that but for some reason, it’s still aligned to the left when I check it in the customizer and when I check the actual site. I’ll just delete the code and add it again to see if that works on my end…as always thanks a million for you help

    Leo

    (@leohsiang)

    So does it work for you on live site?

    I just checked again and it’s working.

    Are you referring to the title in blog/archive page or single post?

    Thread Starter billblast104

    (@billblast104)

    When I check on my laptop and iPad the live site it is not aligned to the center. As you see I don’t have a home page but only 1 blog post thus far, so I’m not sure if that is considered a single post. Yes, I’m referring to the title in the blog post.

    Leo

    (@leohsiang)

    Maybe try this CSS as well:

    h2.entry-title {
        text-align: center;
        font-weight: bold;
    }
    Thread Starter billblast104

    (@billblast104)

    @leohsiand Leo that worked for me right there…thanks again for taking time to help me out…One last question on this subject, will this CSS align all titles for any future posts?

    Leo

    (@leohsiang)

    It should 🙂

    Glad I could help!

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Align post heading’ is closed to new replies.