前端 - 能不能用 CSS3 畫出以下圖形?感謝!
問題描述
圖形如下,就是一個大闊號,箭頭向下。但非前端專業,做的時候自己無從下手,希望高手指點。謝謝。
如果不能,那只能用圖片了。用圖片無法方便控制長度,比較麻煩。
問題解答
回答1:http://codepen.io/lizzz0523/pen/Xmqzxw
回答2:@lizzz_led 的回答很棒。
我也來貢獻個答案吧。主要是減少輸入的計算變量,只需考慮修復 .quote 的高度以及圓角的寬度
<p class='quote'><p></p></p> <style type='text/css'> .quote {position: relative;width: 100%; /* any width */height: 40px;/* fix zero height */ } .quote::before, .quote::after, .quote ::before, .quote ::after {content: ’’;display: block;position: absolute;width: calc(50% - 20px);height: 20px;border-style: solid;border-color: #000;border-width: 0; } .quote ::before, .quote ::after {top: 0;border-bottom-width: 1px; } .quote::before, .quote::after {top: 20px;border-top-width: 1px; } .quote ::before {left: 0;border-bottom-left-radius: 20px; } .quote ::after {right: 0;border-bottom-right-radius: 20px; } .quote::before {left: 20px;border-top-right-radius: 20px; } .quote::after {right: 20px;border-top-left-radius: 20px; } </style>回答3:
不能, 能用 canvas 實現, 畫2跟賽貝爾曲線就行了。建議還是用圖片吧。
回答4:還是用圖片吧。。。
回答5:用圖片吧,居中顯示, 兩側的上翹部分用before,after調試一下吧. 這樣也就最大程度上適應了吧
回答6:即使用圖片,拉長變形了,也不難看吧
回答7:是我孤陋寡聞,ccs3什么鬼,只用過css3
相關文章:
1. mysql - 數據庫建表方面的問題?2. javascript - angular里一個關于ng-bind的問題3. mysql - 我用SQL語句 更新 行的時候,發現全部 中文都被清空了,請問怎么解決?4. python - xpath提取網頁路徑沒問題,但是缺失內容?5. javascript - IOS微信audio標簽不能通過touchend播放6. [前端求職必看]前端開發面試題與答案精選_大綱7. java中這個頁面默認是utf-8編碼的,1輸出亂碼可以理解,可是2就不理解了?8. javascript - 求教各位,本地HTML頁面怎么在DIV中嵌套服務器上的頁面內容?不用iframe。9. python-mysql Commands out of sync10. javascript - angularJS指令如何暴露API給外面的controller使用?
