要在 WebStorm 中新建 CSS 文件:打开项目结构,在目标文件夹右键单击“新建”>“CSS 文件”。输入文件名称,选择预设模板、编码,是否包含文件标题,再单击“创建”。
如何在 WebStorm 中新建 CSS 文件
新建 CSS 文件的步骤:
高级选项:
新创建的 CSS 文件将如下所示:
/*
* CSS Reset
* Eric Meyer's Reset CSS v2.0 (http://meyerweb.com/eric/tools/css/reset/)
*/
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
list-style: none;
}
/* Fix margins for blockquote elements in IE 11+ */
blockquote {
margin: 0;
}
/* Normalize line height for headings 1 to 6 in Chrome, Firefox, and Safari */
h1,
h2,
h3,
h4,
h5,
h6 {
line-height: 1.2;
}
/* Remove all animations and t
ransitions for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
* {
animation-duration: 0ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0ms !important;
scroll-behavior: auto !important;
}
}您现在可以开始在 CSS 文件中编写样式。