Answer a question

I have installed the "HTML CSS Support" extension for VS Code but it only seems to work on files with extension .html. I can't get it to work with .cshtml files unless I rename the file temporarily to html but that's cumbersome.

What's the best way to enable VS Code to provide intellisense for local and remote .css files for use in .cshtml files?

Answers

In order to associate .cshtml files to html formatter, you can insert the following snippet in your settings.json file:

  "files.associations": {
    "*.cshtml": "html"
  }

that way vscode treats .cshtml files like html file and you should be able to use formatters and intellisense in those files.


Besides, you can use this workaround using this extension to change the language-mode-setting of vscode.

Logo

开发云社区提供前沿行业资讯和优质的学习知识,同时提供优质稳定、价格优惠的云主机、数据库、网络、云储存等云服务产品

更多推荐