Forums

[resolved] Make photo center (5 posts)

  1. johnrbarringer
    Member
    Posted 2 years ago #

    I'm new to code/CSS and could really use some help. On my site I've got just a single image that I wanted centered in the middle despite a visitors browser width/height. What's the code to center it?

    Thanks!

    I know that it's probably easy but I'm still not there yet.

    http://www.calvaryorlando.org/exodus/

  2. henkholland
    Member
    Posted 2 years ago #

    Start with rectifiing the errors and especially the one with "<p><img cl***="aligncenter ..."

    Here: http://www.xhtml-css.com/

  3. johnrbarringer
    Member
    Posted 2 years ago #

    Does that tell me how to center the photo? I used simple theme and chopped it up to show just the picture post, but it's all the way to the left when I want it in the middle.

    Thanks though, I'll research what I need with the link you provided. Thanks.

  4. alchymyth
    The Sweeper
    Posted 2 years ago #

    what @henkholland refers to, is the line in the html code in the browser:

    <div class="photo">
    			<p><img cl***="aligncenter size-large wp-image-16"

    where your setup distorted the word 'class' into 'cl***'.
    therefore the style 'aligncenter' is not recognized by the browser, and your image is off-center.

    do you run any 'censoring' plugin, or anything that would consider the letters 'ass' as bad?

    you could overcome this by putting following into style.css:

    .photo img { display:block; margin: 0 auto;
    }

    it would mean than all images later in your posts would be centered, and you loose the ability to influence the image orientation.

  5. johnrbarringer
    Member
    Posted 2 years ago #

    Perfect! Thanks guys!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.