CSS to change the cursor style of the resize button on a textarea
This is rendered by the browser itself and is not part of HTML, therefore it cannot be styled via CSS.
You could use CSS's cursor property on the element's ":after" pseudo element:
#block{
display: block;
width:150px;
height:100px;
border: solid black 1px;
background: red;
}
.resizable{
resize: both;
overflow:auto;
position:relative;
}
.resizable:after{
content:"";
position: absolute;
bottom: 0;
right:0;
display:block;
width:8px;
height:8px;
cursor: nwse-resize;
background-color: rgba(255,255,255,0.5)
}
<div id="block" class="resizable"></div>
(I put a semi transparent white background color to the :after pseudo element so that you can see it's position and size, but you could make it invisible)
There is a simple way in jQuery to deal with this issue.
<script type="text/javascript">
$(function() {
$(document).on('mousemove', 'textarea', function(e) {
var a = $(this).offset().top + $(this).outerHeight() - 16, // top border of bottom-right-corner-box area
b = $(this).offset().left + $(this).outerWidth() - 16; // left border of bottom-right-corner-box area
$(this).css({
cursor: e.pageY > a && e.pageX > b ? 'nw-resize' : ''
});
})
});
</script>
See jsFiddle
One line
$(document).on('mousemove', 'textarea', function(e) { var a=$(this).offset().top+$(this).outerHeight()-16,b=$(this).offset().left+$(this).outerWidth()-16;$(this).css({cursor:e.pageY>a&&e.pageX>b?"nw-resize":""}); })