In my exploration of various Razor views, I've noticed a common practice where developers include a <style>
tag directly in the CSHTML file.
While this method may seem to work without issue, it actually places the <style>
tag within the <body>
section instead of the preferred location inside the <head>
tag.
What is the recommended approach for adding inline CSS to a single razor page so that it appears within the <head>
tag? Is there a best practice to follow?