Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Attach image to ActionLink in MVC 4

I am using ActionLink with id in MVC 4 app and assinging actionLink id an image in css but on on earth I am doing wrong. is not working! here is my code

 <div class="logo_container">
            @Html.ActionLink(" ", "Index", "Home", null, new { id = "_Logo" })
 </div>

CSS

.logo_container {
width:339px;
height:116px; 
}

#_Logo {
background-image: url("../Images/logo.png");
 width:339px;
height:116px;
background-color:green;
}
like image 453
K.Z Avatar asked Dec 02 '22 21:12

K.Z


1 Answers

This is from my application. Works ok:

.logo{
background:no-repeat url(/Content/photo/png/sprite.png) 0 0;
height:15px;
width:20px;
overflow:hidden;
float:left;
border:none;
display:inline;
}

<a href="@Url.Action("Action", "Controller")" class="logo"></a>
like image 187
Andrey Gubal Avatar answered Jan 02 '23 05:01

Andrey Gubal