
- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- 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 - Cursors
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS Advanced
- CSS - Visibility
- 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
- 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 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
Breaking Overflow Text using CSS3
To break overflow text, use the word-wrap property and set it to the value “break-word”. Following is the code displaying how to break overflow text using CSS3 −
Example
<!DOCTYPE html> <html> <head> <style> div { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; border: 3px solid #3008c0; } div.one { width: 200px; word-wrap: normal; } div.two { width: 200px; word-wrap: break-word; } </style> </head> <body> <h1>Div1</h1> <div class="one"> Lorem ipsum dolor sitametconsecteturadipisicjhbjhgjingelit. Rerum, beatae. </div> <h1>Div2</h1> <div class="two"> Lorem ipsum dolor sitametconsecteturadipisicjhbjhgjingelit. Rerum, beatae. </div> </body> </html>
Output
The above code will produce the following output −
- Related Articles
- Handling Text Overflow in CSS3
- Specify Word Breaking Rules using CSS3
- Text in Transparent Box using CSS3
- CSS text-overflow property
- How to limit input text length using CSS3?
- How to arrange text in multi-columns using CSS3?
- How to create CSS3 Box and Text Shadow Effects?
- Heap overflow and Stack overflow
- Setting Column Gap using CSS3
- Performing multiple transitions using CSS3
- Heap overflow and Stack overflow in C
- Breaking Cryptography
- Adjusting the Image Contrast using CSS3
- Setting the Image Brightness using CSS3
- Applying Opacity to Images using CSS3

Advertisements