Home >Backend Development >Golang >Why do I Get 'property value expected css' and 'at-rule or selector expected css' Errors When Using Go Templates in VSCode?

Why do I Get 'property value expected css' and 'at-rule or selector expected css' Errors When Using Go Templates in VSCode?

DDD
DDDOriginal
2024-11-07 08:35:03590browse

Troubleshooting "property value expected css" and "at-rule or selector expected css" Errors When Editing Go Templates in VSCode

When editing Go templates using the html/template package in VSCode, you may encounter errors such as "property value expected css" and "at-rule or selector expected css" when using {{ }} within the style attribute of HTML elements.

Solution:

The issue arises due to VSCode's HTML validation feature. To resolve this, you need to disable the HTML validate styles setting within VSCode.

  1. Open Settings in VSCode (Ctrl , or Command ,).
  2. Search for "html.validate.styles".
  3. Toggle the setting to "Disable" as shown in the screenshot below:

[Why do I Get ](/uploads/20241106/1730891500672b4eec09068.jpg)

After disabling HTML style validation, you should no longer encounter the "property value expected css" or "at-rule or selector expected css" errors when using {{ }} in the style attribute of HTML elements within Go templates.

The above is the detailed content of Why do I Get 'property value expected css' and 'at-rule or selector expected css' Errors When Using Go Templates in VSCode?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn