首页 > 编程知识 正文

鼠标经过事件css鼠标变成小手,css设置鼠标形状

时间:2023-05-06 03:01:53 阅读:196669 作者:191

在 CSS 中可以通过 cursor 样式属性来设置光标的样式;比如放在链接上的样式,光标在文本上的样式,移动时的样式等

属性值作用default光标样式为一个箭头,是默认的样式pointer手形的鼠标样式move移动时的鼠标样式(四个箭头组成的十字)text文本光标not-allowed禁止时的样式ul li { width: 200px; height: 50px; /* 元素水平居中 */ margin: 0 auto; /* 单行文本垂直居中 */ line-height: 50px;}/* 默认 */ul li:nth-child(1):hover { cursor: default; background-color: red;}/* 小手 */ul li:nth-of-type(2):hover { cursor: pointer; background-color: green;}/* 移动时的样式 */ul li:nth-of-type(3):hover { cursor: move; background-color: blue;}/* 文本光标 */ul li:nth-of-type(4):hover { cursor: text; background-color: skyblue;}/* 禁止 */ul li:nth-of-type(5):hover { cursor: not-allowed; background-color: wheat;} <ul> <li>默认样式</li> <li>小手</li> <li>移动时的样式</li> <li>文本光标</li> <li>禁止时的样式</li></ul>

HTML div右边怎么加边框

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。