是否可以给 bootstrap btn 5 分?

2024-03-14

I'm looking to make a bootstrap btn look a little differently with there being a 5 point at the bottom of its base. I know its possible to do shapes this way using the :before and :after tools and transform but I want to put text inside of them which is why I'm having so much trouble. Is it possible to deal directly with the btn class to make this effect happen?enter image description here


您可以使用SkewY如下demo所示:

div {
  height: 100px;
  width: 500px;
  display: inline-block;
  border: 10px solid green;
  border-bottom: none;
  text-align: center;
  line-height: 100px;
  position: relative;
  color: green;
  font-size: 20px;
}
div:before,
div:after {
  content: "";
  border-bottom: 10px solid green;
  position: absolute;
  width: calc(50% + 10px);
  height: 100%;
  top: 0;
}
div:before {
  transform: skewY(5deg);
  left: -10px;
}
div:after {
  transform: skewY(-5deg);
  left: 50%;
}
<div>Request a Quote</div>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

是否可以给 bootstrap btn 5 分? 的相关文章