Visual studio code CSS indentation and formatting

后端 未结 10 1216
梦毁少年i
梦毁少年i 2020-12-12 18:30

I\'d like to know if there is any way to activate auto indent a CSS file in visual studio code with the shortcut ALT+SHIFT+F?

It\'s

相关标签:
10条回答
  • 2020-12-12 19:20

    After opening local bootstrap.min.css in visual studio code, it looked unindented. Tried the commad ALT+Shift+F but in vain.

    Then installed

    CSS Formatter extension.

    Reloaded it and ALT+Shift+F indented my CSS file with charm.

    Bingo !!!

    0 讨论(0)
  • 2020-12-12 19:21

    Yes, try installing vscode-css-formatter extension.
    It just adds the functionality to format .css files and the shortcut stays the same Alt+Shift+F.

    0 讨论(0)
  • 2020-12-12 19:26

    I recommend using Prettier as it's very extensible but still works perfectly out of the box:

    1. CMD + Shift + P -> Format Document
    

    or

    1. Select the text you want to Prettify
    2. CMD + Shift + P -> Format Selection
    
    0 讨论(0)
  • 2020-12-12 19:29

    Beautify (Github) & Prettier (Github) are the best plugin for web development in Visual Studio Code.

    0 讨论(0)
提交回复
热议问题