【问题标题】:How to make border bottom inside block? [closed]如何在块内制作边框底部? [关闭]
【发布时间】:2016-11-02 02:28:43
【问题描述】:

悬停事件后如何使border-bottom在块内?

我尝试过使用 text-shadow,但似乎不是解决方案

【问题讨论】:

标签: css


【解决方案1】:

嵌入框阴影似乎是您所需要的

div {
  height: 75px;
  background: #c0ffee;
}

div:hover {
  box-shadow: inset 0 -5px 0 red;
}
<div></div>

使用伪元素

div {
  height: 75px;
  background: #c0ffee;
  position: relative;
}

div:hover::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 5px;
  background: red;
}
<div></div>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-03
    • 1970-01-01
    • 2018-03-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多