html - CSS需要申请html文件的不同部分

标签 html css

例如我有2个css文件

在一个css文件中我有样式
a{color: blue;} 在第二个文件中我有 a{color: red;}

这些我想申请我的html文件

      <div>
        <a>first file style </a>
      </div>
      <div>
        <a>second file style </a>
      </div>

请建议,我怎样才能得到...提前致谢

最佳答案

设置类

HTML

<div>
<a class="blue">first file style </a>
</div>
<div>
<a class="red">second file style </a>
</div>

CSS

a.blue{color: blue;}

a.red{color: red;}

关于html - CSS需要申请html文件的不同部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27839262/

相关文章:

css - 我应该将 normalize.css 与 jquery mobile 一起使用吗?

html - 将文本置于 CSS 预加载器下方

html - 如何通过 z-index 将一个 div 覆盖到另一个 div

html - 使用 Bootstrap 的小查询

javascript - 单击按钮清除输入字段

html - 导航栏上的下拉问题

css - ReactJS 进度条动画

javascript - 光滑 slider 问题 : displaying thumbnails in vertical columns

html - FFMPEG mkv 到 mp4 的转换在 HTML5 播放器中缺少音频

javascript - 尝试使简单模态示例适应 asp.net 数据列表转发器