Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 72443

How to apply rounded borders to highlight/selection

$
0
0

I have used Visual Studio Online for a while for a project, and the way they apply rounded borders to selections in their online code viewer is very interesting:

http://i.imgur.com/V9dlwSr.png

I've tried inspecting the element and looking for some kind of custom CSS, but had no luck.

I have a feeling this requires some complex "hacks" to make it work, but it seems very interesting as I've never seen it done before.

How are they able to apply rounded borders to a selection?

Note: The normal selection is completely hidden WHILE selecting, and the rounded selection follows your cursor just like a regular selection. Not AFTER you have selected something.

Edit: I have created a fork of @Coma's answer that should work in Firefox and select while the mouse if moving using:

$(document).on('mousemove', function () {

(The borders in certain cases could still use work.)


Viewing all articles
Browse latest Browse all 72443

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>