CSS for aligning the site-title and site -description to the center

  • Author
    Posts
  • #37333

    skyblueguy
    Member

    It’s a basic question (I am new to css.)
    How can I center the site-title and the site-description?

    Thanks.

    The blog I need help with is truthofwmscogandchristahnsahnghong.wordpress.com.

    #37537

    unfunnyme
    Member

    Hi skyblueguy, not sure where the standard theme people are, but you can try adding the following to your css

    #site-title {
    text-align: center;
    }
    
    #site-description {
    text-align: center;
    }

    Let me know if that works!

    #37621

    skyblueguy
    Member

    Thanks.

    #37630

    skyblueguy
    Member

    I noticed that the site-description does not align center.
    I added the following codes, but it does not move the site-description to the center:

    #site-description {
    color: #ADADAD !important;
    font-size: 14px !important;
    /* font-style: italic; */
    position: absolute;
    top: 82px;
    text-align: center;
    }

    Thanks.

    #37681

    To align this to the center please try:

    #site-description {
    position: inherit;
    width: 100%;
    top: 0;
    display: block;
    text-align: center;
    }

    Kind Regards,
    Scott

    #37682

    skyblueguy
    Member

    Hi Scott
    Really thanks for your help.

    I applied your code, and the text now is moved to the center.
    However, this code adds some extra space between the site-description and the men-bar.
    Can I reduce the space between them?

    Best Regards

    #37687

    Awesome, for the spacing try:

    #logo {
    padding: 40px 0 10px;
    }

    Thanks again!

    #37688

    skyblueguy
    Member

    Thanks again for your sincere support.

    Have a great day!

The topic ‘CSS for aligning the site-title and site -description to the center’ is closed to new replies.