Problems with LINK image-background ASP.NET MVC5

0

Because I do not see the image when doing it from the stylesheet, I need it in the header for that reason I do it from a class ...

.font {
  background-position: center;
  background-size: cover;
  background-image: url('../Images/index/font.jpeg');
  min-height: 100%;
}

If I call the image from the cshtml if it appears, but I need the image to adapt to the height of the device

<img src="@Url.Content("~/Images/index/font.jpeg")" alt="Inicio" style="width:100%;position:center;">

Can someone give me a solution? ...

    
asked by Kevin López 12.12.2017 в 00:06
source

1 answer

0

The problem is that you have not entered the directory Content if you analyze the site with the browser developer tools you will see that your image comes out with error 404 try this:

.font {
    background-position: center;
    background-size: cover;
    background-image: url('../Content/Images/index/font.jpeg');
    min-height: 100%;
    }

another thing to note that the html tag to which you have applied the class font is correct, and I would change the class name for another because font poedría entadarte a little. I hope it helps you

    
answered by 12.12.2017 в 16:11