WordPress.org

Support

Support » Themes and Templates » [Resolved] Centering an image header in Easel

[Resolved] Centering an image header in Easel

  • hey
    my site is http://www.d3enews.com

    I am trying to center the header image at the top. When there isn’t an image, I got it and the description to center by putting this in style.css


    #header {
    display: block;
    text-align: center
    margin-left: auto;
    margin-right: auto

    }

    #header .description {
    color:#F3EDF3;
    margin-left: auto;
    margin-right: auto;
    text-align: center

Viewing 3 replies - 1 through 3 (of 3 total)
  • WPyogi

    @wpyogi

    Forum Moderator

    See line 204 of the style.css and change the margin-right to:

    #header {
    display: block;
    margin: 0 auto;
    }

    Thanks for the reply^^ Just a heads up that I had a “text-align: center;” option I had placed in #header cuz I had text in there before, and for some reason text-align was blocking margin-left/right: auto; from doing anything.

    Another heads up: for anyone who might find this post while searching for help on an easy question like this:
    You will save yourself hours and hours of time if you go spend 30 minutes reading an introduction to css like that of w3 schools (or some other decent css tutorial site). If I had done that a week ago I would of saved myself hours and hours of random stupid little problems like this. A basic overview of how the .css sites work makes it 1000000x easier.

    WPyogi

    @wpyogi

    Forum Moderator

    Yes, very good advice indeed on doing a bit of CSS learning!

    And text-align: center is really not meant to be used with block elements (images) — though many people do use it that way.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Centering an image header in Easel’ is closed to new replies.