Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi I'm using MVC application to display set of images by using foreach loop. now i want display the name center of each images.(names like label).

Here my code...

MVC View code.


<div>
          @foreach(var image in ViewBag.publist)
          { 
           <a href="@Url.Action(" pubfuldetails=", " pub=",new { ID = image.ID   },null)"><img class="imgOpa" src="@image.Username" style="width:250px;height:180px;"  hspace="10"; vspace="30"; /></a>
  
    
           }
</div>


CSS code...

HTML
 <style type="text/css">

    .imgOpa
    {

        transition: all .2s ease-in-out;
    }
        .imgOpa:hover
        {
             box-shadow: 10px 10px 5px #888888;
             transform: scale(1.1);
        }
/*.imageHolder
 { position: relative;}
 .imageHolder .caption
 { position: absolute;top: 40%; left: 0px; color:#fff; text-align:center; font-weight:bold;}*/
 .image-slide-title:hover {
  cursor:pointer;
}
</style>
Posted
Updated 13-Jul-15 1:31am
v3
Comments
MSVelu8788 13-Jul-15 7:22am    
am used the foreach with in the <div>

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