Html+CSS繪制三角形圖標
先看看效果圖:
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Document</title>
- <style type="text/css">
- #test1 {
- height:20px;
- width:20px;
- border-color:#FF9600 #3366ff #12ad2a #f0eb7a;
- border-style:solid;
- border-width:20px;
- }
- #test2 {
- height:0;
- width:0;
- overflow: hidden; /* 這里設(shè)置overflow, font-size, line-height */
- font-size: 0; /*是因為, 雖然寬高度為0, 但在IE6下會具有默認的 */
- line-height: 0; /* 字體大小和行高, 導致盒子呈現(xiàn)被撐開的長矩形 */
- border-color:#FF9600 #3366ff #12ad2a #f0eb7a;
- border-style:solid;
- border-width:20px;
- }
- #test3 {
- height:0;
- width:0;
- overflow: hidden;
- font-size: 0;
- line-height: 0;
- border-color:#FF9600 transparent transparent transparent;
- border-style:solid;
- border-width:20px;
- }
- #test4 {
- height:0;
- width:0;
- overflow: hidden;
- font-size: 0;
- line-height: 0;
- border-color:#FF9600 transparent transparent transparent;
- border-style:solid dashed dashed dashed;
- border-width:20px;
- }/*兼容IE6*/
- #test5 {
- height:0;
- width:0;
- overflow: hidden;
- font-size: 0;
- line-height: 0;
- border-color:#FF9600 #3366ff transparent transparent;
- border-style:solid solid dashed dashed;
- border-width:40px 40px 0 0 ;
- }
- </style>
- </head>
- <body>
- <div id="test1"></div><br>
- <div id="test2"></div><br>
- <div id="test3"></div><br>
- <div id="test4"></div><br>
- <div id="test5"></div><br>
- </body>
- </html>
以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持我們。
上一篇:HTML的a標簽href屬性指定相對路徑與絕對路徑的用法講解
欄 目:CSS/HTML
本文標題:Html+CSS繪制三角形圖標
本文地址:http://mengdiqiu.com.cn/a1/CSS_HTML/9633.html
您可能感興趣的文章


閱讀排行
本欄相關(guān)
- 04-02表格樣式css樣式,css樣式表單
- 04-02好看的字體樣式css,好看的字體樣式圖
- 04-02分頁樣式css,分頁樣式j(luò)q
- 04-02分頁樣式css,分頁樣式欄里用來定義首
- 04-02css樣式的引入,css樣式怎么引入
- 04-02css滾動條樣式,css滾動條的樣式
- 04-02css樣式引入方式有幾種,網(wǎng)頁引入css樣
- 04-02html中加入css樣式的簡單介紹
- 04-02vue中的css樣式布局,vue添加css樣式
- 04-02內(nèi)嵌樣式css,內(nèi)嵌樣式表,內(nèi)部樣式表
隨機閱讀
- 01-11常用的HTML富文本編譯器UEditor、CKEdi
- 01-10vue實現(xiàn)分頁加載效果
- 01-10C++實現(xiàn)將數(shù)組中的值反轉(zhuǎn)
- 01-10C++ 類訪問控制的條件總結(jié)
- 08-05dedecms織夢模板全站調(diào)用收藏數(shù)的方法
- 01-10C語言打印楊輝三角示例匯總
- 08-05織夢dedecms首頁調(diào)用縮略圖為背景
- 08-05dedecms織夢模板編輯文檔的同時自動更
- 08-05DEDECMS點擊主欄目默認顯示第一個子欄
- 01-10bat批處理徹底隱藏文件的方法(使用