WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] CSS image centering issue (10 posts)

  1. Nile Flores
    Member
    Posted 4 years ago #

    Alright, I put this layout together and coded it for a friend, but she and I are just too close to the project to even get a clue now. She uses her WordPress gallery for her pictures and what is happening is that even though her output code for the image is correct, I have narrowed it down to the CSS that the image is not centering correctly. You can view this issue on her website:

    http://asnotseenontv.info/

    The css for it is as followed. I appreciate if someone can give some insight on a solution to this.

    [huge chunk of code moderated - please use a pastebin or link to file]

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    Try adding:

    .aligncenter {
    	display: block;
    	margin-left: auto;
    	margin-right: auto;
    }
    
    .alignleft {
    	float: left;
    }
    
    .alignright {
    	float: right;
    }

    to the bottom of the theme's stylesheet.

  3. Nile Flores
    Member
    Posted 4 years ago #

    After applying and clearing cache, I am still not getting this issue.

    For further look -

    http://asnotseenontv.info/wp-content/themes/asnotseenontv/style.css

    I appreciate it!

  4. Nile Flores
    Member
    Posted 4 years ago #

    bump

  5. Nile Flores
    Member
    Posted 4 years ago #

    bump

  6. Peter Boosten
    Member
    Posted 4 years ago #

    Although these classes exist in your css (I suspect, I didn't check), there's no way the image knows it has to apply these settings, since there's no connection between the image and the class.

    This might help:

    .post img {
    	display: block;
    	margin-left: auto;
    	margin-right: auto;
    }

    Peter

  7. Nile Flores
    Member
    Posted 4 years ago #

    thanks... I will go try to look and apply. If it does not work, I may be back.

  8. Nile Flores
    Member
    Posted 4 years ago #

    Issue still is a problem. After some validations HTML side and some corrections, at least the images show up with their captions. However, it is still not obeying the aligncenter.

  9. Mike Little
    Member
    Posted 4 years ago #

    Try adding :

    .wp-caption.aligncenter {
      display: block;
      margin-left: auto;
      margin-right: auto;
    }

    to your style sheet

    Mike

  10. Nile Flores
    Member
    Posted 4 years ago #

    Mike -

    *bows profusely*

    Let me go feel dumb in the corner...lol

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.