4
I am creating a button on a given page and would like to put a background image.
I’m trying to tag background-image:url()
in CSS but not working.
HTML:
@model WebApplication3.Models.Comercial.ComercialModels
@{
ViewBag.Title = "Index";
}
<div id="Open_menu">
<span onclick="openNav()">Menu</span>
</div>
<h2>Comercial</h2>
<div id="mySidenav" class="sidenav">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
<a href="#">@Html.ActionLink("Home", "Index", "MenuInicial")</a>
<a href="#">@Html.ActionLink("Serviços", "Index", "Servicos")</a>
<a href="#">@Html.ActionLink("Comercial", "Index", "Comercial")</a>
<a href="#">@Html.ActionLink("Estoque", "Index", "Estoque")</a>
<a href="#">@Html.ActionLink("Equipamentos", "Index", "Equipamentos")</a>
<a href="#">@Html.ActionLink("Compras", "Index", "Compras")</a>
<a href="#">@Html.ActionLink("Fiscal", "Index", "Fiscal")</a>
<a href="#">@Html.ActionLink("Caixa", "Index", "Caixa")</a>
</div>
<div>
<input type="button" class="but_clientes">
</div>
CSS:
/*botao abrir menu lateral*/
#Open_menu {
position: fixed;
cursor:pointer;
margin-left: -150px;
margin-top: 350px;
font-size: 20px;
transform: rotate(270deg)
}
.but_clientes {
width: 300px;
height: 100px;
background-color: transparent;
background-image:url('C:\clientes.png');
border: groove
}
Canvas:
Project hierarchy:
Update, A folder has been created in the project called Image
but it still didn’t work:
Send me the project hierarchy. Where the html and css are.
– Mauro Alexandre
I did a review.
– Thomas Erich Pimentel
files cannot be served through c: -- you have to use a server and serve the files from that folder, such as
images/imagem.png
– MoshMage
I created a folder called image, and still it was not, I made a review in the question
– Thomas Erich Pimentel
@Moshmage worked, I was typing the wrong way.
– Thomas Erich Pimentel