前端 - 類似這種圖例怎么實(shí)現(xiàn)效果比較好
問題描述
問題解答
回答1:可以用線性漸變.
<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è)如果是,不需要來加動(dòng)態(tài)效果,這個(gè)還是很好做的,最可恥的方法 扔給美工姐姐去,讓她直接給你P出來個(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. javascript - JS如何取對稱范圍的隨機(jī)數(shù)?2. java - ehcache緩存用的是虛擬機(jī)內(nèi)存么?3. 數(shù)據(jù)庫 - mysql如何處理數(shù)據(jù)變化中的事務(wù)?4. android - java 泛型不支持?jǐn)?shù)組,那么RxJava的Map集合有什么方便的手段可以定義獲得一串共同父類集合數(shù)據(jù)呢?5. java - mongodb分片集群下,count和聚合統(tǒng)計(jì)問題6. 關(guān)于docker下的nginx壓力測試7. 服務(wù)器端 - 采用nginx做web服務(wù)器,C++開發(fā)應(yīng)用程序 出現(xiàn)拒絕連接請求?8. javascript - 有什么兼容性比較好的辦法來判斷瀏覽器窗口的類型?9. dockerfile - 我用docker build的時(shí)候出現(xiàn)下邊問題 麻煩幫我看一下10. python - pandas按照列A和列B分組,將列C求平均數(shù),怎樣才能生成一個(gè)列A,B,C的dataframe
