.player { padding: 50px; cursor: pointer; } .player .range { width: 100%; height: 100%; padding: 10px; background: whitesmoke; } .player .range .option { width: 50%; height: 100%; background-color: #808080; padding: 10px; font-size: 8pt; font-family: sans-serif; text-align: center; } <div class="player"> <div class="range"> <div class="option">50%</div> </div> </div> How to calculate in percent the position of the cursor on the width inside the block?
I want to make a slider for the player.
The code is of interest - to clog the site with a huge cloud of plug-ins is not a hunt.