I am trying to make images coming from links within my mySQL database appear next to each other. Here is my code:

<div class="container-outer">
    <div class="container-inner">
        <?php if ( $imagePath = $article->getImagePath( IMG_TYPE_THUMB ) ) { ?>
        <a href=".?action=viewArticle&amp;articleId=<?php echo $article->id?>"><img class="articleImageThumb" src="<?php echo $imagePath?>" alt="Article Thumbnail" /></a>
        <?php } ?>
    </div>
</div>

The images appear seperatly below each other and I can't quite figure out how to make them appear on the same line. Thanks!

Recommended Answers

This would be due to divs being block elements.
Changing your divs to block-inline usually works. Maybe just inline.

.container-inner{
    display: block-inline;
}
Jump to Post

If block-inline doesn't work, try inline-block.

Jump to Post

All 5 Replies

Member Avatar

This would be due to divs being block elements.
Changing your divs to block-inline usually works. Maybe just inline.

.container-inner{
    display: block-inline;
}

If block-inline doesn't work, try inline-block.

commented: Quite right! +14
Member Avatar

Yep, Jorge - got into all-a-muddle :)

Lol, no worries just having some fun with that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.