国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > CSS > 正文

純CSS繪制三角形箭頭圖案技術解析

2024-07-11 08:32:45
字體:
來源:轉載
供稿:網友

最近我想修改一下這個網站,我想在上面放置一個提示框。這是很容易,但我想讓提示框上有一個三角形的箭頭。可是,一想到這需要使用圖片,并且各種顏色,各種方向的箭頭要準備無數種,這幾乎是一種災難。幸運的是,MooTools的核心開發著Darren Waddell告訴了我一個非常棒的技術:用CSS繪制三角形箭頭。使用純CSS,你只需要很少的代碼就可以創作出各種瀏覽器都兼容的三角形箭頭!

CSS代碼

CSS Code復制內容到剪貼板
  1. /* create an arrow that points up */   div.arrow-up {   
  2.  width: 0;      height: 0;    
  3.  border-left: 5px solid transparent;  /* left arrow slant */    border-right: 5px solid transparent; /* right arrow slant */  
  4.  border-bottom: 5px solid #2f2f2f; /* bottom, add background color here */    font-size: 0;   
  5.  line-height: 0;    }   
  6.    /* create an arrow that points down */  
  7. div.arrow-down {     width: 0;    
  8.  height: 0;      border-left: 5px solid transparent;   
  9.  border-right: 5px solid transparent;     border-top: 5px solid #2f2f2f;   
  10.  font-size: 0;     line-height: 0;   
  11. }      
  12. /* create an arrow that points left */   div.arrow-left {   
  13.  width: 0;      height: 0;    
  14.  border-bottom: 5px solid transparent;  /* left arrow slant */    border-top: 5px solid transparent; /* right arrow slant */  
  15.  border-right: 5px solid #2f2f2f; /* bottom, add background color here */    font-size: 0;   
  16.  line-height: 0;    }   
  17.    /* create an arrow that points right */  
  18. div.arrow-rightright {     width: 0;    
  19.  height: 0;      border-bottom: 5px solid transparent;  /* left arrow slant */  
  20.  border-top: 5px solid transparent; /* right arrow slant */    border-left: 5px solid #2f2f2f; /* bottom, add background color here */  
  21.  font-size: 0;     line-height: 0;   
  22. }   
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 石嘴山市| 凤冈县| 安多县| 临桂县| 辽源市| 都昌县| 河东区| 濉溪县| 永州市| 江安县| 保靖县| 辽源市| 房山区| 兴宁市| 邓州市| 鸡西市| 石泉县| 高唐县| 全椒县| 洛浦县| 汾西县| 德安县| 云安县| 马鞍山市| 咸丰县| 上犹县| 潜山县| 沾化县| 如皋市| 崇州市| 温宿县| 上高县| 宜春市| 都匀市| 芜湖县| 醴陵市| 波密县| 威信县| 澎湖县| 磐安县| 永修县|