css 向左向下箭头

html-css011

css 向左向下箭头,第1张

使用

当然,其他任意方向也是可以的,只需要控制旋转角度rotate即可。原理是构造了一个正方形,隐藏了其中的两条边left和bottom,然后进行旋转。

通过使用正方形左下两条边,并向下向右平移,再旋转,得到一个向下并居中的箭头

就用div加css就能做出这种效果了.给你一个刚写的例子。

<div style='background:redheight:20pxwidth:30pxdisplay: inline-block'></div>

<div style='top:5pxheight: 0pxborder: 15px red solidwidth: 20pxborder-top-color: transparentborder-right-color: transparentborder-bottom-color: transparentdisplay: inline-blockposition: relativeleft: -4px'></div>

select一直是html里的怪胎,很多属性不受css控制的,所以才会出现很多div+css的下拉插件,如果项目需要 非要用元素select的话,可以在select上做一个小小的遮罩,通过定位到下拉箭头,挡住后面的箭头就行了。

纯手打,望采纳!