css 样式设计

这个当点击的时候怎么设计这个箭头样式。

神不在的星期二
浏览 451回答 3
3回答

子衿沉夜

<!DOCTYPE html><html><head>&nbsp; <meta charset="UTF-8">&nbsp; <title>Title</title>&nbsp; <style>&nbsp; &nbsp; .item {&nbsp; &nbsp; &nbsp; background-color: deepskyblue;&nbsp; &nbsp; &nbsp; margin-bottom: 8px;&nbsp; &nbsp; &nbsp; width:160px;&nbsp; &nbsp; &nbsp; position: relative;&nbsp; &nbsp; &nbsp; height:40px;&nbsp; &nbsp; &nbsp; line-height: 40px;&nbsp; &nbsp; }&nbsp; &nbsp; .item::after {&nbsp; &nbsp; &nbsp; content: '';&nbsp; &nbsp; &nbsp; position: absolute;&nbsp; &nbsp; &nbsp; left:100%;&nbsp; &nbsp; &nbsp; width: 0;&nbsp; &nbsp; &nbsp; height: 0;&nbsp; &nbsp; &nbsp; border-top: 20px solid transparent;&nbsp; &nbsp; &nbsp; border-bottom: 20px solid transparent;&nbsp; &nbsp; &nbsp; border-left: 20px solid deepskyblue;&nbsp; &nbsp; }&nbsp; </style></head><body><ul style="list-style: none;">&nbsp; <li class="item">2+2双学士本科项目</li>&nbsp; <li class="item">1+1双学士学位</li></ul></body></html>

温温酱

在这个DIV里用伪元素的border画三角形然后定位就行。演示demo

MMTTMM

矩形+三角形 三角形用border做
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript