简体   繁体   English

在Chrome开发者工具中添加新的CSS类

[英]Add a new CSS class in Chrome developer tool

Is it possible to add a whole new CSS class like this in Chrome dev tools? 是否可以在Chrome开发工具中添加这样的全新CSS类?

.myclass {
    background-color: yellow;
}

On the Elements tab there's a styles tab which contains a small + button on the right side. Elements选项卡上有一个styles选项卡,右侧包含一个小+按钮。

新风格规则

When you click here, you can add a whole new CSS class. 单击此处后,您可以添加一个全新的CSS类。

在此输入图像描述

Once you've defined the new class, see Add a class to an element to learn how to apply it to an element. 定义新类后,请参阅向元素添加类以了解如何将其应用于元素。 You could also just double-click the element in the DOM Tree on the Elements panel to add or edit the element's class attribute. 您也可以双击Elements面板上DOM树中的元素来添加或编辑元素的class属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM