Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I try to make an image gallery, like this:

C#
<div id="tabs-2">


    <link href="~/Content/ShowMoreImages.css" rel="stylesheet" />


    @foreach (var item in Model.LolaBikePhotos)
    {
        @model  ContosoUniversity.Models.UserProfile
        <div class="container">
            <ul class="row">

                <li class="col-lg-4 col-md-2 col-sm-3 col-xs-4"><img src="/Images/profile/@item.ImagePath" alt="" height=150 width=200 /></li>
            </ul>
        </div>
    }




</div>

But the problem is now that all the images are in a row under each other, and not horizontal alligned, like a matrix.

Thank you
Posted
Updated 29-Apr-15 22:27pm
v2

1 solution

You should place the container and row element outside the foreach loop.
 
Share this answer
 
Comments
[no name] 3-May-15 7:33am    
Yes, thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900