html - Css 没有反映在 html 中
问题描述
我的 .css 文件中有这个
.attachment-label {
font-size: 10px;
font-style: italic;
color: rgba(0,0,0,.5);
}
我尝试在我的 html 中使用它,如下所示:
<div class="card-body">
<span class="attachment-label">Attachment</span>
<hr style=" margin-top: 0; margin-bottom: .5rem; border: 0; border-top: 1px solid rgba(0,0,0,.1);"/>
<div class="text-center">
<img class="card-img-top imageThumbnail" src="@TicketHeader.AttachmentPath" />
</div>
</div>
它不适合我的跨度。但是,如果我像这样将样式内联:
<div class="card-body">
<span style=" font-size: 10px; font-style: italic; color: rgba(0,0,0,.5);">Attachment</span>
<hr style=" margin-top: 0; margin-bottom: .5rem; border: 0; border-top: 1px solid rgba(0,0,0,.1);"/>
<div class="text-center">
<img class="card-img-top imageThumbnail" src="@TicketHeader.AttachmentPath" />
</div>
</div>
有用。我究竟做错了什么?
解决方案
我认为你没有链接你的 .css 文件
<link rel="stylesheet" href="css/your.css">
推荐阅读
- android - Windows Batch - 通过变量传递空间以在 ADB 命令中使用
- scala - 尝试在 Scala 中编写通用过滤器函数
- genetic-algorithm - 基因组可以是异质的并表达具有异质元素的实体吗?
- angular - Angular / TS - 如何从组件调用函数到服务并获取返回值
- javascript - 在iframe中使用`window.top.$`发送ajax请求,但是referer不是iframe src的url
- bash - 如何制作一个循环来获取输入和输出
- excel - Excel INDEX / MATCH / MATCH 跨单元格范围
- python - df.drop(
) 从 df 中删除具有该索引的所有行,但保留 在 df.index - sql - SQL Server - Exists 的替代方案(子查询太多)
- node.js - 使用 Winston 将 nodejs 应用程序记录到 DigitalOcean Spaces