I want to change the background color of razor code inside cshtml to recognize it faster when I’m scrolling. I want to change whole text not only @.
How can I do that?
use Razor syntax to generate the HTML and CSS for the page, including a #content div for our dynamic content. Then, we add a JavaScript block to the bottom of the page that listens for the "scroll" event and updates the background color of the #content div accordingly.
2
Answers
I finally solve my issue. I went to tools>options>Text Editor>HTML>Advanced and turn legacy razor editor to true. Now I have what I want.
You can use javascript to change the background color.
use Razor syntax to generate the HTML and CSS for the page, including a #content div for our dynamic content. Then, we add a JavaScript block to the bottom of the page that listens for the "scroll" event and updates the background color of the #content div accordingly.