css - 努力用模板中的 Logo 替换 Font Awesome 图标

标签 css html html-table

我正在使用 html5up 模板制作网站,并且 html 的一部分在我想用我的 png Logo 更改的范围内有一个菱形图标类。

菱形图标不在图片文件夹中,也不在 css 中,所以我不确定如何有效地替换圆圈中的图像?其内容如下:

<div class="logo"> <span class="icon fa-diamond"> </span> </div>

只是想知道我会将我的图像放在哪个文件夹中,它会是 SASS 代码吗? java ?

如果您需要更多信息,请告诉我。

最佳答案

这个图标不是图像。这是名为:Font awesome 的字体。如果你想替换这个图标,只需从 span 中删除这个类并添加你的 img

 <span class="logo"> <img class="logo__img" src="/img/yourimg.img" alt="this is your image"><span/>

查看您的模板默认 style.css 文件并检查 class="icon fa-diamond"样式并将其复制到您的 img.png,但请确保将 font-size 样式更改为图像的高度。

.logo {
/* replace this value to a value from Font Awesome icon style*/
width: 2rem; 
height: 2rem;
}
.logo__img {
display: block;
width: 100%;
}

关于css - 努力用模板中的 Logo 替换 Font Awesome 图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54908796/

相关文章:

html - 动态复选框 CSS 和 Bootstrap

html - 如何制作可调整大小的 html/css 布局(肯定是重复的)?

html - 在我添加内容之前,在遵循教程到底部后页脚被定位?

html - 在 CSS 中将多行插入边框?

css - 两个没有换行符的内联表

html - 如何让flex-grow忽略填充?

html - 为什么不 justifyContent : space-between work?

css - 图像在 TD 中未垂直对齐

css - 同一表格单元格中的两种字体大小

html - 当附加垂直滚动条时,列会移动