亚洲一区在线播放-欧美另类极品videosbest使用方法-亚洲成人av在线播放-黄色录像大片-色悠悠av-91欧美日韩-中文字幕偷拍-综合色婷婷一区二区亚洲欧美国产-一级爱爱片-黑人添美女bbb添高潮了-久久青娱乐-黄色一级视屏-美女国产在线-亚洲九九九九-欧美 日韩 国产 成人 在线观看-星空大象mv高清在线观看免费-国产福利合集-好吊色视频在线观看-尤物综合网-18岁成年人网站

用CSS繪制三角形箭頭

2016/11/3 8:59:24   閱讀:1999    發布者:1999

用CSS繪制三角形箭頭。使用純CSS,你只需要很少的代碼就可以
創作出各種瀏覽器都兼容的三角形箭頭!

 

CSS代碼:

/* create an arrow that points up */ 
div.arrow-up { 
    width: 0;  
    height: 0;  
    border-left: 5px solid transparent;  /* left arrow slant */ 
    border-right: 5px solid transparent; /* right arrow slant */ 
    border-bottom: 5px solid #2f2f2f; /* bottom, add background color here */ 
    font-size: 0; 
    line-height: 0; 
} 

/* create an arrow that points down */ 
div.arrow-down { 
    width: 0;  
    height: 0;  
    border-left: 5px solid transparent; 
    border-right: 5px solid transparent; 
    border-top: 5px solid #2f2f2f; 
    font-size: 0; 
    line-height: 0; 
} 

/* create an arrow that points left */ 
div.arrow-left { 
    width: 0;  
    height: 0;  
    border-bottom: 5px solid transparent;  /* left arrow slant */ 
    border-top: 5px solid transparent; /* right arrow slant */ 
    border-right: 5px solid #2f2f2f; /* bottom, add background color here */ 
    font-size: 0; 
    line-height: 0; 
} 

/* create an arrow that points right */ 
div.arrow-right { 
    width: 0;  
    height: 0;  
    border-bottom: 5px solid transparent;  /* left arrow slant */ 
    border-top: 5px solid transparent; /* right arrow slant */ 
    border-left: 5px solid #2f2f2f; /* bottom, add background color here */ 
    font-size: 0; 
    line-height: 0; 
} 

繪制這些三角形的關鍵在于,你要讓箭頭所指方向的兩個側邊有很粗的邊框。而背向箭頭
方向的一邊也是同樣粗的邊框,而這條邊的顏色就是你的三角形的顏色。邊框越粗,
三角形越大。用這種方法你可以繪制出各種顏色、各種大小、各種朝向的箭頭。
最妙的是,你只需要幾行CSS代碼就能實現這種效果。