JNemune
JNemune

Reputation: 1

Shortcut commenting on internal CSS in VSCode

I try to comment a line in internal CSS in HTML file (in style element) using Ctrl + / but VSCode comment the line like html (using <!-- -->) like this

I know I should use /* */ but I want to know how can I comment a line in internal CSS using VSCode shortcut?

Note: I use Version: 1.60.2 (user setup) and these are my extensions.

Upvotes: -1

Views: 12486

Answers (4)

Gautam
Gautam

Reputation: 1

Settings > keyboard shortcuts > Emmet Toggle Comment

It will be set to the default source Add a key binding to it, and it will work.

Upvotes: 0

Zed
Zed

Reputation: 1

The default shortcut in Windows is Ctrl+#.

Alternatively, you can search for "Toggle comment" under File -> Preferences -> Keyboard Shortcuts and enter the desired key combination.

Upvotes: 0

user20366487
user20366487

Reputation: 31

Try this in vs code:

Settings > keyboard shortcuts > Emmet Toggle Comment

It will be set to the default source Add a key binding to it, and it will work.

Upvotes: 3

moghwan
moghwan

Reputation: 2277

The alternative shortcut to comment code is Ctrl+K, Ctrl+C, and for uncommenting it's Ctrl+K, Ctrl+U.

For some languages, CSS for example, Ctrl+K, Ctrl+C work as toggle for both states.

Upvotes: 5

Related Questions