Tailwind CSS: How to Disable Text Selection

In Tailwind CSS, you can prevent text from being selected by using the select-none utility class.
Example:
The code:
<body class="bg-green-200 p-20 space-y-3">
<p class="text-xl text-blue-500">This text is selectable</p>
<p class="select-none text-xl italic text-red-500">This text is unselectable</p>
</body>
Further reading:
- Using Tailwind CSS with Font Awesome Icons: A Deep Dive
- Tailwind CSS: Create a Responsive Top Navigation Menu
- Tailwind CSS: How to Create a Stepper
- Full-Screen Search Box with Tailwind CSS
- Tailwind CSS: Create an Animated & Closable Side Menu
- Tailwind CSS: How to Create Parallax Scrolling Effect
You can also check out our CSS category page for the latest tutorials and examples.
Subscribe
0 Comments