html - 如何更改代码中已经定义的 css 样式?
问题描述
我有一个代码,代码中有类和 css 样式。我看不到也无法更改此 CSS 代码。所以我的 css 不适用于这个跨度。但是我需要根据需要更改这种 css 样式。我需要蓝色作为跨度。我怎么能这样做?尽快帮助我。谢谢。
.grid {
display: block;
}
.grid .item {
color: blue;
}
<div class="grid">
<p>I need change</p>
<span class="item" style="color:red;">This is change place!!!</span>
</div>
解决方案
使用 !important 标签
.grid .item { color: blue !important; }
推荐阅读
- c - 如何让编译器警告我缺少返回值?
- python - 在 Django 中为新帖子保存 category_id
- android - 第二个活动的 Anko 布局未显示
- automation - 尝试使用 autohotkey 对本地 html 文件执行某些处理时出现“rpc 服务器不可用”
- javascript - React-Native & Redux “动作必须是普通对象。为异步函数使用自定义中间件”
- javascript - 下一个图像功能在调用时不显示
- node.js - ionic 3 中的 socket.io 客户端不工作?
- python - python f'string 在 pd.Series.map 函数中不起作用
- php - 无法在后端设计配置中更改 magento2 主题
- windows - Windows 命令行:在新的控制台窗口中执行 .bat 文件