- 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 - 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 - 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 Advanced
- CSS - Flexbox
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Media Types
- CSS - Paged Media
- CSS - Aural Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS - Image Sprites
- CSS - Important
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS3 - Rounded Corner
- CSS3 - Border Images
- CSS3 - Multi Background
- CSS3 - Color
- CSS3 - Gradients
- CSS3 - Shadow
- CSS3 - Text
- CSS3 - Web font
- CSS3 - 2d transform
- CSS3 - 3d transform
- CSS3 - Animation
- CSS3 - Multi columns
- CSS3 - User Interface
- CSS3 - Box Sizing
- CSS - Tooltips
- CSS - Buttons
- CSS - Pagination
- CSS - Variables
- CSS Responsive
- CSS - Responsive Web Design
- 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
- Selected Reading
- Q&A
CSS - Hypens
CSS Hypens
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 Hypens - None
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.
Example
Here is an example −
<html lang="en"> <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 Hypens - Manual
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.
Example
Here is an example −
<html lang="en"> <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 Hypens - Auto
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.
Example
Here is an example −
<html lang="en"> <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 Hypens - Initial
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.
Example
Here is an example −
<html lang="en"> <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 Hypens - Inherit
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.
Example
Here is an example −
<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>