- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Selectors
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Border Block
- CSS - Border Inline
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursor
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS - Inline Block
- CSS - Dropdowns
- CSS - Visibility
- CSS - Overflow
- CSS - Clearfix
- CSS - Float
- CSS - Arrows
- CSS - Resize
- CSS - Quotes
- CSS - Order
- CSS - Position
- CSS - Hyphens
- CSS - Hover
- CSS - Display
- CSS - Focus
- CSS - Zoom
- CSS - Translate
- CSS - Height
- CSS - Hyphenate Character
- CSS - Width
- CSS - Opacity
- CSS - Z-Index
- CSS - Bottom
- CSS - Navbar
- CSS - Overlay
- CSS - Forms
- CSS - Align
- CSS - Icons
- CSS - Image Gallery
- CSS - Comments
- CSS - Loaders
- CSS - Attr Selectors
- CSS - Combinators
- CSS - Root
- CSS - Box Model
- CSS - Counters
- CSS - Clip
- CSS - Writing Mode
- CSS - Unicode-bidi
- CSS - min-content
- CSS - All
- CSS - Inset
- CSS - Isolation
- CSS - Overscroll
- CSS - Justify Items
- CSS - Justify Self
- CSS - Tab Size
- CSS - Pointer Events
- CSS - Place Content
- CSS - Place Items
- CSS - Place Self
- CSS - Max Block Size
- CSS - Min Block Size
- CSS - Mix Blend Mode
- CSS - Max Inline Size
- CSS - Min Inline Size
- CSS - Offset
- CSS - Accent Color
- CSS - User Select
- CSS Advanced
- CSS - Grid
- CSS - Grid Layout
- CSS - Flexbox
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Paged Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS - Image Sprites
- CSS - Important
- CSS - Data Types
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS - Rounded Corner
- CSS - Border Images
- CSS - Multi Background
- CSS - Color
- CSS - Gradients
- CSS - Box Shadow
- CSS - Box Decoration Break
- CSS - Caret Color
- CSS - Text Shadow
- CSS - Text
- CSS - 2d transform
- CSS - 3d transform
- CSS - Transition
- CSS - Animation
- CSS - Multi columns
- CSS - Box Sizing
- CSS - Tooltips
- CSS - Buttons
- CSS - Pagination
- CSS - Variables
- CSS - Media Queries
- CSS - Functions
- CSS - Math Functions
- CSS - Masking
- CSS - Shapes
- CSS - Style Images
- CSS - Specificity
- CSS - Custom Properties
- CSS Responsive
- CSS RWD - Introduction
- CSS RWD - Viewport
- CSS RWD - Grid View
- CSS RWD - Media Queries
- CSS RWD - Images
- CSS RWD - Videos
- CSS RWD - Frameworks
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
CSS - hyphens
CSS hyphens property controls how words are broken into lines when text is too long to fit on a single line. This property can be used to improve the readability of text that wraps across multiple lines.
The property only applies to block-level elements.
Following are all possible values that can be used for property hypens:
none − No hyphenation is allowed.
manual − It specifoes manual hyphenation behavior for text in WebKit-based browsers.
auto − Hyphenation is allowed at appropriate hyphenation points, as determined by the browser.
initial − The initial value, which is manual.
inherit − The value inherited from the parent element.
CSS hyphens - none Value
The hyphens: none property value prevents hyphenation of words. It will not be broken into lines, even if they are too long to fit on a single line.
<html> <head> <style> .container { border: 2px solid #12782f; background-color: #2fe262; width: 60px; } .hyphenated-none { hyphens: none; } </style> </head> <body> <div class="container"> <p class="hyphenated-none">It is a long established Contrary to popularised.</p> </div > </body> </html>
CSS hyphens - manual Value
When you use the CSS hyphens: manual property, hyphenation is only allowed at points where the user has explicitly inserted hyphens. This is a default value.
<html> <head> <style> .container { border: 2px solid #12782f; background-color: #2fe262; width: 60px; } .hyphenated-manual { hyphens: manual; } </style> </head> <body> <div class="container"> <p class="hyphenated-manual">It is a long establ-ished Contrary to popula-rised.</p> </div > </body> </html>
CSS hyphens - auto Value
You can use the CSS hyphens: auto property to let the browser automatically hyphenate words at points that are considered to be appropriate, according to the language's hyphenation rules.
<html> <head> <style> .container { border: 2px solid #12782f; background-color: #2fe262; width: 60px; } .hyphenated-auto { hyphens: auto; } </style> </head> <body> <div class="container"> <p class="hyphenated-auto">It is a long established Contrary to popularised.</p> </div> </body> </html>
CSS hyphens - initial Value
CSS hyphens: initial property sets the hyphens property to its initial value. The initial value for the hyphens property is manual, which means that hyphenation is only allowed at points where the user has explicitly inserted hyphens.
<html> <head> <style> .container { border: 2px solid #12782f; background-color: #2fe262; width: 60px; } .hyphenated-initial { hyphens: initial; } </style> </head> <body> <div class="container"> <p class="hyphenated-initial">It is a long establ-ished Contrary to popu-larised.</p> </div > </body> </html>
CSS hyphens - inherit Value
When you use the hyphens: inherit property, the value of the hyphens property is inherited from the parent element. The hyphenation of the element will be the same as the hyphenation of its parent element.
<html lang="en"> <head> <style> .container { border: 2px solid #12782f; background-color: #2fe262; width: 60px; padding: 2px; hyphens: auto; } .hyphenated-inherit { border: 2px solid #ac3f08; background-color: #f05e40; hyphens: inherit; } </style> </head> <body> <div class="container"> There are many variations of embarrassing of Lorem Ipsum. <p class="hyphenated-inherit">It is a long establ-ished Contrary to popu-larised.</p> </div > </body> </html>