Search code examples
asp.net-corerazor-pages

Styling issue in Razor pages


Looking at the generated Assembly.styles.css there are IDs or whatever it is called.

enter image description here

But these IDs are not appearing in the generated HTML.

enter image description here

Which results that the styling does not become applied.

enter image description here


Solution

  • CSS isolation is a build step, so it does not work when Razor runtime compilation is enabled.

    Make sure that you haven't enabled runtime compilation of your Razor files.

    Related GitHub issue