前端 - 類(lèi)似這種圖例怎么實(shí)現(xiàn)效果比較好
問(wèn)題描述
問(wèn)題解答
回答1:可以用線(xiàn)性漸變.
<p class='linear'></p>
.linear{ width: 300px; height: 10px; border-radius: 5px; background-image: linear-gradient(to right, red 25%, blue 25%, blue 50%, green 50%, green 75%, gray 75%);}
https://jsfiddle.net/mmdgtj1e/
回答2:這是靜態(tài)圖嗎?假設(shè)如果是,不需要來(lái)加動(dòng)態(tài)效果,這個(gè)還是很好做的,最可恥的方法 扔給美工姐姐去,讓她直接給你P出來(lái)個(gè)PNG直接用要是自己弄得換這個(gè)用行內(nèi)元素拼接唄,然后設(shè)置邊框
.common{ display:inline-block; width: 100px; float: left;}.clearfix{ *zoom: 1; }.clearfix:after { display: table; clear: both; content: ''; }.one{border-top:3px solid #ddd;}.two{border-top:3px solid #e34;}.three{border-top:3px solid #532;}.four{border-top:3px solid #244532;}.five{ border-top:3px solid #ccc;}----------<p class='clearfix'><span class=’one common’>1</span><span class=’two common’>10</span><span class=’three common’>100</span><span class=’four common’>1000</span><span class=’five common’>10000</span></p>
相關(guān)文章:
1. linux - 編譯時(shí)提示頭文件#include <mysql/mysql.h>不存在,百度之后也沒(méi)解決2. html - 內(nèi)嵌app 的web 頁(yè)面如何應(yīng)用 app 內(nèi)置的靜態(tài)文件3. javascript - immutable配合react提升性能?4. JAVA 版本問(wèn)題?5. node.js - webpack --watch以后報(bào)錯(cuò)env: node: No such file or directory6. html頁(yè)面中怎么將兩個(gè)點(diǎn)之間的距離用直線(xiàn)連接起來(lái)?7. java - yuicompressor-maven-plugin 合并可用卻不壓縮, 哪配置不對(duì)?8. css3 - 如何出現(xiàn)橫向捲軸?9. java - Spring +Mybatis 事務(wù) 不能回滾10. PHP類(lèi)中的$this
