javascript - 我可以让一个 css div 类模拟一个不同的 css div 类吗?

标签 javascript jquery css twitter-bootstrap

我刚开始为我的网站使用 Bootstrap 。我喜欢它的外观,我想对大量不同的博客文章进行一些更改以包含 Bootstrap 样式。我不想通过数百篇文章来更改 div 的类元素。我可以做这样的事情吗:

<div class="important_note">
this is a old note that I want to use bootstrap styling on.
</div>

CSS:

<style>
.important_note{
  mimick(.alert)
}
</style>

alert 是一种 Bootstrap 样式。

如果这是一个简单的问题,我深表歉意,但网络开发不是我的专长。我也找不到任何类似的问题。感谢您的帮助!

最佳答案

使用 css 你可以做以下事情:

.important_note, .alert{
//styling
}

这将对 important_note 和 alert 类应用相同的样式

关于javascript - 我可以让一个 css div 类模拟一个不同的 css div 类吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16805265/

相关文章:

php - html/php 随机图像生成器 - 根据屏幕尺寸对齐图像

html - 如何使用html和css绘制图形?

javascript - 将鼠标悬停在图像上时如何输出按钮和文本?我需要使用 JQuery 吗?

javascript - jQuery 插件反馈

javascript - 使用 flot 绘制具有双 y 轴的组合条形图和折线图

javascript - 单击按钮上的动画滑动 div jQuery

javascript - 检查连接 JavaScript

javascript - 对象数组 : return only objects (and children) where attribute matches

javascript - 带有 Gmail 和 NodeJS 的 Nodemailer

javascript - 我应该将 S3 存储桶与 form_for 图像 uploader 一起使用吗?