jayesh_n Ответов: 1

Как установить как изображение, так и текст для элемента управления linkbutton в ASP.NET через CSS ?


I want linkbutton control in asp.net to have both icon and text for login, add update delete etc (.png or .gif) with it.

I have googled and find some posts saying its possible through css with following code:

.clslnkbutton {
background: url(../images/icons/login.png) no-repeat left top;
display:inline;
padding-left:18px;
margin-left: 10px;
padding-right:10px;
}

<asp:LinkButton ID="LinkButton1" CssClass="clslnkbutton" runat="server">Login</asp:LinkButton>

But, after trying above code still its not displaying image.
Please suggest some solution.


Что я уже пробовал:

<asp:LinkButton ID="LinkButton1" CssClass="clslnkbutton" runat="server">Login</asp:LinkButton>


.clslnkbutton {
background: url(../images/icons/login.png) no-repeat left top;
display:inline;
padding-left:18px;
margin-left: 10px;
padding-right:10px;
}

1 Ответов

Рейтинг:
1

Karthik_Mahalingam

попробовать это

.clslnkbutton { 
            padding:5px;
            padding-left:25px;
            border:1px solid red;  
            background-image: url(./Images/save.png);
             background-position: 2px; 
             background-repeat: no-repeat; 
        }