by default the content root is the wwwroot folder. move the images folder to the wwwroot folder.
custom header and footer in ASP.NET Core MVC project
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;
back
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.
Thanks,
elsvieta
ASP.NET Core
-
Bruce (SqlWork.com) 75,871 Reputation points Moderator
2023-10-16T18:48:34.39+00:00
1 additional answer
Sort by: Most helpful
-
Anonymous
2023-10-17T03:11:04.2+00:00 Hi,@elsvieta
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 inwwwroot
folder ,also checkapp.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