1.小三角,經過給一個div設置足夠大的邊框,讓它的上邊框,右邊框,左邊框,的背景顏色設置成透明的,來實現,以下:css
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> #demo { width: 0; height: 0; /*邊框的寬20px*/ border-width: 20px; /*邊框樣式,實線*/ border-style: solid; /*邊框顏色*/ border-color: transparent transparent red transparent; } </style> </head> <body> <!--小三角,transparent透明的,--> <div id="demo"> </div> </body> </html>
2.a標籤的移動端問題:html
1》當再點擊a標籤的時候,它會有默認的背景顏色,解決辦法web
1 -webkit-tap-highlight-color:transparent; spa
2》當點擊時可能會出現下劃線,解決方法code
1 text-decoration: none; //或者 2 3 border: none;//或者 4 5 outline:none;
3>當鼠標放上去時顯出下劃線,解決辦法;htm
a:hover{ text-decoration:none; }
a標籤是一個行內標籤,若是要設置它的寬高或多個樣式可經過display:block;將其變爲塊級標籤。blog