VS Code Tips - Fix Multiline Comments in CSS/HTML @CSSWeekly
VS Code Tips - Fix Multiline Comments in CSS/HTML  @CSSWeekly
Uploaded March 2024 | Updated September 2026, 1 hour ago
Visual Studio Code tip showing you how to fix broken block comments behavior in CSS/HTML when toggling a comment adds a new comment instead of uncommenting the focused comment.

EDIT: Jayden Pearse noted in the comments that you can use "resourceLangId" instead of "resourceExtname," which will also work on files without an extension, as long as the correct language (CSS or HTML) is detected or set manually.

BETTER When Expression: editorTextFocus && !editorReadonly && (resourceLangId == 'html' || resourceLangId == 'css')

When Expression shown in the video: editorTextFocus && !editorReadonly && (resourceExtname == '.css' || resourceExtname == '.html')

Subscribe to CSS Weekly Newsletter:
πŸ’Œ css-weekly.com

Help support my channel
πŸ‘¨β€πŸŽ“ Get a course: masteringlinting.com
πŸͺ§ Buy a CSS sticker pack: stickers.css-weekly.com
πŸ’– Support me on Patreon: patreon.com/cssweekly

πŸ“– Chapters
00:00 Problem with block comments in VS Code
01:39 Use Emmet to toggle block comments in CSS/HTML
02:23 Add Keyboard Shortcut to β€œEmmet: Toggle Comment” command
03:33 Restrict Keyboard Shortcut to CSS & HTML files
06:49 Why you should use Emmet Toggle Comments command in VS Code

Keep up-to-date with CSS Weekly:
🐦 Twitter: twitter.com/@cssweekly
🎢 TikTok: tiktok.com/@cssweekly
πŸŽ‡ Instagram: instagram.com/cssweekly
πŸ“˜ Facebook: facebook.com/CSSWeekly

Keep up to date with what I'm up to:
πŸ‘¨β€πŸ’Ό Blog: zoranjambor.com
πŸ’Ό LinkedIn: linkedin.com/in/zoranjambor

- Zoran Jambor
#css #vscode
VS Code Tips - Fix Multiline Comments in CSS/HTMLCreate Complex Transitions With Individual CSS Transform PropertiesFrontend News #10: Gradient Borders, Perfect Centering, Animating Details/SummaryFrontend News #21: Multi-Column Layouts, :heading Pseudo-Class, Scaling ElementsNesting Media Queries in CSS & Sass10 Fantastic VS Code Icon ThemesIntroducing AI Developer Weekly Newsletter10 Incredible CSS-Only CodePens (2023)Enable THIS in DevTools when working with CSS GridBest Programming Fonts (2024)Debug Web Layout Problems With This Simple CSS Trick! #cssTop Visual Studio Code Product Icon Themes
CSS Weekly |

VS Code Tips - Fix Multiline Comments in CSS/HTML

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER