Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

คุณสมบัติ CSS user-select


ใช้คุณสมบัติ CSS user-select เพื่อกำหนดว่าข้อความขององค์ประกอบสามารถเลือกได้หรือไม่

ตัวอย่าง

<!DOCTYPE html> <html>    <head>       <style>          div {             user-select: none;          }       </style>    </head>    <body>       <h2>This is demo heading</h2>       <div>This is demo text. You won't be able to select it.</div>    </body> </html>