Have you ever noticed that when you highlight text in a textarea
, the selection stays within the boundaries of the textarea itself? Take a look:
But when you try to select text in other elements, such as a basic div
, the selection spills out of the element like this:
Is there a CSS property or some other method to confine the selection within the HTML element?