- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Adding Hyphens to Text with the CSS hyphens Property
Using the CSS hyphens property, we can specify how hyphens are added in text.
Example
The following examples illustrate CSS hyphens property.
<!DOCTYPE html> <html> <head> <style> div { width: 20%; border: 2px groove lime; margin: 10px; padding: 10px; hyphens: none; -webkit-hyphens: none; -ms-hyphens: none; } div:last-of-type { hyphens: manual; -webkit-hyphens: manual; -ms-hyphens: manual; } </style> </head> <body> <div> abcdefghijklmnopqrstuvwxyz </div> <div> abcdefghijklmnopqrstuvwxyz </div> </body> </html>
Output
This will produce the following result −
Example
<!DOCTYPE html> <html> <head> <style> div { margin: 10px; padding: 10px; width: 15%; border: 2px ridge darkblue; background-color: peachpuff; -webkit-hyphens: auto; -ms-hyphens: auto; hyphens: auto; } </style> </head> <body> <div> abcdefghijklmno-pqrstuvw-xyz </div> <div> abcdefghi-jklmnopqrstuvw-xyz </div> </body> </html>
Output
This will produce the following result −
- Related Articles
- CSS hyphens Property
- How to remove hyphens using MySQL UPDATE?
- How to combine duplicate values into one with corresponding value separated by hyphens in MySQL?
- Indent Text with CSS text-indent Property
- Extract the middle part of column values in MySQL surrounded with hyphens and display in a new column?
- CSS text-emphasis property
- CSS text-overflow property
- CSS text-align-last property
- Animate CSS text-shadow property
- Animate CSS text-indent property
- text-justify Property in CSS
- Animate CSS text-decoration-color property
- Usage of text-transform property in CSS
- Usage of text-decoration property in CSS
- Usage of text-indent property in CSS

Advertisements