Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • BS5 Tutorial
  • BS5 Interview Questions
  • BS5 Layout
  • BS5 Content
  • BS5 Components
  • BS5 Helpers
  • BS5 Utilities
  • BS4 Tutorial
  • BS Tutorial
  • Bootstrap Cheatsheet
  • Tailwind
  • CSS Frameworks
  • HTML Formatter
Open In App
Next Article:
Bootstrap 5 Interactions Text Selection
Next article icon

Bootstrap 5 Interactions Text Selection

Last Updated : 29 Nov, 2022
Comments
Improve
Suggest changes
Like Article
Like
Report

Bootstrap 5 Interactions Text selection helps us to change the way when a user tries to select the content displayed. 

Bootstrap 5 Interactions Text selection Classes:

  • user-select-all: When this class is active the entire text will get selected.
  • user-select-auto: When this class is active user can select any amount of text.
  • user-select-none: When this class is active user cannot select any text.

Syntax: The * can be substituted with values like all, auto, and none.

<p class="user-select-*">      ...  </p>

Example 1: In this example, we will learn about classes like user-select-all and user-select-auto.

HTML
<!DOCTYPE html> <html> <head>     <link href= "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"            rel="stylesheet"         integrity= "sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"          crossorigin="anonymous"> </head>  <body>     <div >         <h1 class="text-success">             GeeksforGeeks         </h1>         <h2>Bootstrap5 Interactions Text selection</h2>         <p class="user-select-all">             GeeksforGeeks is a computer science portal         </p>         <p class="user-select-auto">             It provides learnings of various kind              of courses like Java, C++, Python,              Javascript etc.         </p>     </div> </body> </html> 

Output:

Bootstrap 5 Interactions Text Selection

Example 2: In this example, we will learn about classes like user-select-none.

HTML
<!DOCTYPE html> <html> <head>     <link href= "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"            rel="stylesheet"           integrity= "sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"            crossorigin="anonymous"> </head>  <body class="m-5">     <div >         <h1 class="text-success">             GeeksforGeeks         </h1>         <h2>Bootstrap 5 Interactions Text selection</h2>         <p class="user-select-none">             GeeksforGeeks is a computer              science portal         </p>     </div> </body> </html> 

Output:

Bootstrap 5 Interactions Text Selection

References: https://getbootstrap.com/docs/5.0/utilities/interactions/#text-selection


Next Article
Bootstrap 5 Interactions Text Selection

A

abhiisaxena09
Improve
Article Tags :
  • Technical Scripter
  • Web Technologies
  • Bootstrap
  • Technical Scripter 2022

Similar Reads

    Bootstrap 5 Interactions Pointer Events
    In bootstrap 5, Interactions is a utility class that controls how elements of a website are interacted with (how the user interacts with them). Pointer events in Interactions come with pe-none and pe-auto classes, to prevent or add element interactions. Let's see each of them in brief. Interactions
    2 min read
    Bootstrap 5 Introduction
    Bootstrap is a free and open-source collection of CSS and JavaScript/jQuery code used for creating dynamic websites layout and web applications. Bootstrap is one of the most popular front-end frameworks which has really a nice set of predefined CSS codes. Bootstrap uses different types of classes to
    4 min read
    Bootstrap 5 Text Line height
    Text Line height classes are used to set the gap between the two lines. there are several classes to set the line height. The default line height of the class is lh-base. Bootstrap 5 Text Line height Classes: ClassDescriptionlh-1Set line height to 1lh-smSet line height to smalllh-baseSet line height
    2 min read
    Bootstrap 5 Text Reset color
    Text Reset color is used to reset the text color or linked text's color. We all know by linking any text we got a blue-colored text. Sometimes we want to remove that color and make it looks like normal text. Text Reset Color Class: text-reset: This class is used to reset the text color. Syntax: <
    2 min read
    Bootstrap 5 Select Default
    Bootstrap 5 Select Default stylizes dropdown menus, enhancing user experience. However, limitations exist in modifying option styles due to browser constraints, despite offering various customization options for select elements. Bootstrap 5 Select Default Class: form-select: This class is used to tr
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences