css - Bootstrap,scss,在scss代码中使用一些类名,而不是写在html文件中
问题描述
在 Bootstrap 4 中,我可以将text-truncate
其用作元素中的类。例如:
<span class="text-truncate">Any very long text</span>
我现在需要的是text-truncate
在一个 scss 文件中为许多对象使用这个类,而不是直接在 .html 文件中编写它。
如何?
我可以使用类似的东西:
@import "text-truncate" from "bootstrap.scss";
.myBeautifulDiv {
use text-truncate;
}
这会很棒!可能吗?
解决方案
完全有可能。去这里(https://getbootstrap.com/docs/4.1/getting-started/download/),点击“下载源代码”,你要找的可能在_scss文件夹中。
推荐阅读
- tensorflow - tensorflow 2.x 分布式集群
- android-room - 如何在 WorkManager 中获取 Room Database ViewModel 实例?
- javascript - 使用连字符格式化 yaml 数据以写入文件打字稿
- sql-server - 如何在 Access VBA 中捕获缺少访问错误代码的特定 SQL Server 错误?
- thymeleaf - Thymeleaf 使用箭头键
- node.js - 使用 CTE 插入多个表不适合我
- javascript - 在 npm run android 之后,React Native Metro Server 没有启动
- laravel - DigitalOcean Spaces 不适用于 AWS 开发工具包 PHP
- snowflake-cloud-data-platform - 与 golang 驱动程序一起使用的雪花占位符格式
- javascript - 在 React 中为搜索同步事件处理程序