css 伪类做箭头指向

.box{
  width: 200px;
  height: 40px;
  background-color:red;
  margin: 0 auto;
}
.box:after{
  position: relative;
  top: 48px;
  content: '';
  border-top: 10px solid red;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
}

css 伪类做箭头指向

.box{
  width: 200px;
  height: 40px;
  background-color:red;
  margin: 0 auto;
}
.box:after{
  position: relative;
  top: -26px;
  content: '';
  border-bottom: 10px solid red;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
}

css 伪类做箭头指向

.box{
  width: 200px;
  height: 40px;
  background-color:red;
  margin: 0 auto;
  position: relative;
}
.box:after{
  position: absolute;
  top: 10px;
  right: -10px;
  content: '';
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 10px solid red;
}

css 伪类做箭头指向

.box{
  width: 200px;
  height: 40px;
  background-color:red;
  margin: 0 auto;
  position: relative;
}
.box:after{
  position: absolute;
  top: 10px;
  left: -10px;
  content: '';
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 10px solid red;
}

css 伪类做箭头指向

上一篇:Web前端学习第五天——————HTML、CSS篇.020CSS简写


下一篇:微信开发-发送给朋友,分享到朋友圈开发