在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML5/ css3如何實現(xiàn)這樣的圖形

css3如何實現(xiàn)這樣的圖形

圖片描述

需求是這樣的:寬度不定
該如何實現(xiàn)呢

回答
編輯回答
不二心

clipboard.png

 .border{
            width: 0;
            height: 0;
            border-left: 50px solid red;
            border-right: 50px solid red;
            border-top: 50px solid red;
            border-bottom: 50px solid transparent; 
        }
    

把寬度設置成你想要的就可以了,不定的話可以使用CSS 的var來定義,或者用less或sass這種

2017年9月10日 19:50
編輯回答
呆萌傻

找UI小姐姐給你做一個不就好了

2018年8月11日 10:10
編輯回答
奧特蛋
<div id='chevron'></div>
#chevron {
  position: relative;
  text-align: center;

  margin-bottom: 6px;
  height: 34px;
  width: 200px;
  background:red;
}
#chevron:before {
  width: 0px; 
   height: 0px; 
   border-top: 12px solid red; 
   border-right: 100px solid transparent; 
  position:absolute;
  left:0;
  top:100%;
  content:'';
}
#chevron:after{
  width: 0px; 
      height: 0px; 
      border-top: 12px solid red; 
      border-left: 100px solid transparent;
  position:absolute;
  right:0;
  top:100%;
  content:'';
}
2018年9月14日 11:19