css - 悬停在框的边框上时如何获得 "resize"类型的光标?

标签 css mouse-cursor

我正在尝试更改 :default 的游标属性至 :se-resize当悬停在框的边框上时。有什么办法可以在 CSS 中做到这一点吗?请在 CSS 中我需要选项!

HTML:

<textarea placeholder="..."></textarea>   

CSS:

textarea {
width: 510px;
height: 140px;
padding: 5px 0;
border:2px solid #dddddd;
outline-style:none;
color: #777777;

最佳答案

在这里,尝试使用具有悬停 CSS 的包装 DIV。

.border {
  background-color: red;
  cursor: e-resize;
  padding: 5px;
}

.contents {
  background-color: white;
  cursor: default;
  height: 100px;
  line-height: 100px;
  text-align: center;
}
<div class="border">
<div class="contents">
  Hello World
</div>
</div>

也在这里:https://jsfiddle.net/vyk4c21b/9/

关于css - 悬停在框的边框上时如何获得 "resize"类型的光标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42744016/

相关文章:

java - 在 Swing 中,有没有办法从工具包中提取预定义的鼠标光标图像?

html - 在具有更高 z-index 的重叠 div 上可见光标

C# 隐藏调整大小光标

php - 提交后动态隐藏表单,所有用户

html - 如何使用 CSS 或 velocity 在首页显示 div

css - Bootstrap 按钮处于事件状态且目标样式不起作用

CSS3 过渡以一种方式工作,但不能以另一种方式工作

html - 更改 font-awesome 圆形图标的背景颜色

c++ - 如何确定当前鼠标光标是否处于动画状态?

jquery - 使用 jQuery 删除拖动的元素并重置光标