前端 - 類似這種圖例怎么實現效果比較好
問題描述
問題解答
回答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:這是靜態圖嗎?假設如果是,不需要來加動態效果,這個還是很好做的,最可恥的方法 扔給美工姐姐去,讓她直接給你P出來個PNG直接用要是自己弄得換這個用行內元素拼接唄,然后設置邊框
.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>
相關文章:
1. javascript - react+百度地圖2. html5 - iOS的webview加載出來的H5網頁,怎么修改html標簽select的樣式字體?3. vue.js - vue+webpack+vue-router 部署到nginx服務器下,非根目錄,前后端怎樣配置文件?4. javascript - 為什么當index等于5的時候,不在當前頁面跳轉到百度?不跳轉的代碼在倒數第五行5. angular.js - 關于angular react vue 我們在什么實際的開發項目中使用?如何選擇?6. 手動啟動mysql服務出錯,1067錯誤,如何解決呢?7. index.php錯誤,求指點8. 這是什么情況???9. 請教一條mysql的sql語句寫法;10. 跟著課件一模一樣的操作使用tp6,出現了錯誤
