css - 如何在 CSS 中添加特定的类
问题描述
如果我向我的 div 添加一个 css 类,它将被 v-slot-tradeMatrixLayout 覆盖。如何在我的 CSS 文件中专门指定这个类,以便只调用它。tradeMatrixLayout 被赋予一个 VerticalLayout。
这将在 chrome 中进行检查
<div class="v-slot v-slot-tradeMatrixLayout">
这是我的 CSS 文件
.tradeMatrixLayout{
margin-left: 15px !important;
}
div 如何调用我专门编写的课程?
解决方案
您还可以使用 javascript 通过操作 DOM 来添加类。
function myFunction() {
var el = document.getElementsByClassName("v-slot");
el.classList.add("tradeMatrixLayout");
}
推荐阅读
- php - 更新作曲家错误显示后:未找到接口“Symfony\Contracts\Translation\LocaleAwareInterface”
- swift - 处理来自firebase的Null ref
- python - for循环中的引用变量嵌入在for循环中
- c# - 我如何通过用户名对datagridview的值求和
- java - 使用定时器的电梯程序
- django - Django 2.1 create 方法来创建嵌套字段(外键关系)。使用 Django 的 Rest 框架
- jenkins - 如何连接 Jenkins 和 Gieta
- typescript - 输入'选择
' 不能与类型 'Selection ' - r - 保存在列表中时,绘图中动态选择的变量无法正确呈现,但可以正常工作
- java - Java 流:flatMap 返回对象流