Making Text Non-selectable with CSS in HTML


While not an HTML attribute, you can make text non-selectable using CSS, demonstrating how HTML and CSS work together to control web content presentation.

Source Code


    .no-select {
        -webkit-user-select: none; /* Safari */
        -moz-user-select: none; /* Firefox */
        -ms-user-select: none; /* IE 10+ and Edge */
        user-select: none; /* Standard syntax */
    }

This text cannot be selected.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments