custom header and footer in ASP.NET Core MVC project

elsvieta 326 Reputation points

hi all,

I just created my first Asp.Net Core MVC project. I am trying to customize my site background.

I created a folder images and I copied a bunch of .png files there. I intend to use one of the .png files as a background for the footer. Where is the best place to add code so that I add the picture to the footer?

I tried:

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    white-space: nowrap;
    line-height: 60px;
	background-image: url("/images/LOGO_01.png");

in _Layout.cshtml.css

and I also tried the same in site.css.

The project launches but the background pic does not show up.


A set of technologies in the .NET Framework for building web applications and XML web services.
4,229 questions
0 comments No comments
{count} votes

1 additional answer

Sort by: Most helpful
  1. Ruikai Feng - MSFT 2,526 Reputation points Microsoft Vendor


    You could check your console( any 404 error) of browser if the image has been served,if its' ok, add the css codes in your _Layout.cshtml.css

    it was not served, check if your check your images folder locates in wwwroot folder ,also check app.UseStaticFiles() middleware , if you modified the requestpath of StaticFileOptions or content root path of file providers.

    For more details,you could check this document related

    0 comments No comments