是否有可能给自举btn一个5点?

时间:2016-04-30 17:50:06

标签: css twitter-bootstrap css-shapes

我正在寻找一个引导btn看起来有点不同,它的底部有一个5点。我知道有可能使用:before和:after工具和转换这样做,但我想把文本放在它们里面,这就是为什么我有这么多麻烦。有可能直接处理btn类来实现这种效果吗?enter image description here

2 个答案:

答案 0 :(得分:1)

您可以使用SkewY,如下面的演示所示:

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>

答案 1 :(得分:0)

渐变可以是第一种芯片方法......

情况中的示例:http://codepen.io/gc-nomade/pen/wGEyvd

&#13;
&#13;
button {
  color:green;
  display:block;
  width:50%;
  margin:1em auto;
  padding:1.5em 0 2.5em;
  border:none;
  background:linear-gradient(to left, green, green) top,
    linear-gradient(to bottom, green,green) top left,
    linear-gradient(to bottom, green,green) top right,
    linear-gradient(to bottom left, transparent 45%, green 47%, green 51%, transparent 52%) bottom left,
    linear-gradient(to bottom right, transparent 45%, green 47%, green 51%, transparent 52%) bottom right;
  background-repeat:no-repeat;
  background-size:100% 3px, 3px 70%, 3px 70%,50% 30%, 50% 30%;
}
&#13;
<button>REQUEST A CODE</button>
&#13;
&#13;
&#13;