How to center header text (site-title and tagline)?

  • Author
    Posts
  • #29008
    Nyks

    I want to center the header-text, which shows the site-title and the tagline (description).
    Changing the left spacing/padding alot, isnt a real solution, because it dont works on the mobile (responsive) view.

    I found a custom-CSS, posted for the mantra-theme. It centers the title, but dont works for the tagline.

    Is there any way to center both?

    custom-CSS for title (without tagline):

    #site-title {
    float: none;
    margin: 0;
    padding: 0;
    text-align: center;
    }
    #30744
    Martin R.

    Yes, it is possible. The ID for the tagline is #illuminati (just kidding). The tag is
    #site-description and the following settings do the trick:

    #site-description {
    	display: block;
    	float: none;
    	font-size: 20px;
    	line-height: 1.5em;
    	margin-top: 5px;
    	padding: 3px 6px;
    	clear: both;
    	font-weight: 300;
    	text-align: center;
    }

    The main setting here is the ‘float’, which has to be set to ‘none’ in order for the text-align to work, apparently. Hope this helps.

    #30926
    jan

    Great, it works.
    Thank you!

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘How to center header text (site-title and tagline)?’ is closed to new replies.