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

All 5 Replies

Member Avatar for diafol

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 for diafol

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 meeting, networking, learning, and sharing knowledge.