在 GitHub 上查看
图像替换
使用图像替换类将文本替换为背景图像。
警告
自 v4.1 起,text-hide()
类和混合已弃用。它将在 v5 中完全移除。
使用 .text-hide
类或混合来帮助将元素的文本内容替换为背景图像。
<h1 class="text-hide">Custom heading</h1>
// Usage as a mixin
.heading {
@include text-hide;
}
使用 .text-hide
类来保持标题标签的可访问性和 SEO 优势,但希望使用 background-image
而不是文本。
Bootstrap
<h1 class="text-hide" style="background-image: url('...');">Bootstrap</h1>