WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [boldy theme] How to display centered images inline? (10 posts)

  1. samb0005
    Member
    Posted 3 years ago #

    Hi

    Wonder if anyone can help me cos despite playing around with the code and searching the forum I just can't find an answer to what I think it probably a very simple problem.

    I want to have a row of 3 thumbnails on a page and have them centred and in a single line.

    When I use the code `#content #colLeft img.aligncenter {
    margin-left: auto;
    display: block;
    margin-right: auto;}`
    everything is centred however the images are on different lines (so one image below another). If I change the display to inline, then the images are all on the same line but become left aligned. I've tried putting in text-align: center but unfortunately that has made no difference.

    Any help would be appreciated!!

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Unless you provide a link to a page demonstrating the problem, no one will be able to offer much in the way of assistance.

  3. samb0005
    Member
    Posted 3 years ago #

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    I can't see any obvious problems with that page.

  5. samb0005
    Member
    Posted 3 years ago #

    The three images are below each other (see link to screenprint) rather than on the same line. Any suggestions would be appreciated!
    www

  6. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    set the images to 'alignnone';
    set the paragraph to text-align:center;
    and edit style.css:

    #content #colLeft img {
    
    	margin: 0;
    
    	height: auto;
    
    	max-width: 640px;
    
    	width: auto;
    	display:block;
    
    }

    remove the display:block; which is stopping the images to be on one line.

  7. samb0005
    Member
    Posted 3 years ago #

    Thanks for your reply. I have followed your advice but while this has made the images appear on the same line, they are not centred.

    When you said 'set the paragraph to text-align:center;' does that mean in the visual editor, clicking on each picture and hitting the 'centre' text button?

    The code for .alignnone is as follows - does this need to be changed at all do you know?

    #content #colLeft .alignnone{margin:10px;}

    Thanks

  8. samb0005
    Member
    Posted 3 years ago #

    Ok, if I centre the last sentence of the text before the images as well as the images, then it makes the images go in the centre, which if all else fails will be great.

    Not to be super fussy ... but is there a way where I can keep my images in the centre, but still have left aligned text?

    Thanks for all the help, I really appreciate it.

  9. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    does that mean in the visual editor, clicking on each picture and hitting the 'centre' text button?

    i would try to highlight all three images, and click the 'text center' button - untested, no guarantee.

    i just had a look at your site, and it seems that you are to close to success ;-)

  10. samb0005
    Member
    Posted 3 years ago #

    All sorted! Thanks so much for all the help :)

Topic Closed

This topic has been closed to new replies.

About this Topic