WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Centering an image header in Easel (4 posts)

  1. d3enews
    Member
    Posted 2 years ago #

    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
    '

  2. WPyogi
    Volunteer Moderator
    Posted 2 years ago #

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

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

  3. d3enews
    Member
    Posted 2 years ago #

    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.

  4. WPyogi
    Volunteer Moderator
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic