【发布时间】:2022-04-17 01:14:53
【问题描述】:
我正在使用Sage Starter Theme,并且我正在添加一些 CSS 来设置 _global.scss 文件中的全局链接样式。 Bootstrap 覆盖了文件 _reboot.scss 中的一些 CSS 属性。
_global.scss
这种样式为我的所有链接添加了悬停效果的基本下划线。
a {
font-family: $font__lato !important;
text-decoration: none;
color: brown;
position: relative;
overflow: hidden;
&:focus {
outline: none;
}
&:after {
content: "";
position: absolute;
z-index: -1;
right: 0;
width: 0;
bottom: -5px;
background: red;
height: 2px;
transition-property: width;
transition-duration: 0.3s;
transition-timing-function: ease-out;
}
&:hover:after,
&:focus:after,
&:active:after {
left: 0;
right: auto;
width: 100%;
}
}
_reboot.scss
在不使用!important 或直接编辑_reboot.scss 的情况下应用我自己的text-decoration: none; 样式的正确方法是什么?
感谢您的帮助。
【问题讨论】:
-
更改包含 CSS 文件的顺序。
标签: css sass bootstrap-4