Search code examples
htmlcssasp.netrazorbackground-image

How do I set a background image for an ASP.NET web application?


I currently have this, but it is not setting the background as expected:

<body style: background-image url()>

Also I need it to be a file not a link


Solution

  • Looks like @Sverre beat me to the suggestion of moving your CSS style to a separate file. If you prefer to leave it directly in the tags, you will have to reformat it a bit like so:

    <body style="background-image: url('https://yourdomain.com/some-image.png')">