29 Mart 2016 Salı

.Net Mvc Html ActionLink Arka Plan Resmi

Yorum Bırak
Html ActionLink'ler için arka plan resmi vererek bir button gibi kullanmak istiyorsak bunu ActionLink'in css özellikleri ile oynayarak aşağıdaki gibi değiştirebiliriz:



<%= Html.ActionLink("Button Name", "Index", null, new { @class="classname" }) %>


a.classname
{
    background: url(../Images/image.gif) no-repeat top left;
     display: block;
     width: 150px;
     height: 150px;
     text-indent: -9999px; /* hides the link text */
}

0 yorum:

Yorum Gönder