首页 > 解决方案 > 如何使用 WebStorm 清理 CSS 中的代码

问题描述

有什么方法可以清理 WebStorm 上的代码?

我的意思是这样

清洁前

.container {
    position: absolute;
    background-color: #1e1939;
    width: 100%;
    top: 50%;
}

清洁后

.container {
    width: 100%;
    background-color: #1e1939;
    position: absolute;
    top: 50%;
}

Ctrl + Shift + Alt如果您使用 Android Studio,您会在输入 XML时理解我的意思。

标签: csswebstorm

解决方案


您可以使用 Code Style CSS 选项为您的 css 文件配置格式选项,看看:

https://www.jetbrains.com/help/webstorm/settings-code-style-css.html

看看“安排”部分。

捷径:Ctrl + Alt + S


推荐阅读