AgerNic.com
WEB DEVELOPER SITE, HTML, CSS, PHP, SQL
HTML Tutorial

CSS Text Wrap


CSS Tutorial » CSS Text Wrap


CSS word-wrap property allows big words to be able to be broken and wrap anywhere on the edge of a box onto the next line.

We can add CSS word-wrap Property as:
Inline - by using the style attribute in HTML elements
Internal - by using a <style> element in the <head> section
External - by using an external CSS file as style.css

Syntax:

Syntax: Internal & External CSS.
word-wrap: normal or break-word or initial or inherit;

Note: use external CSS instead.


How to create CSS word-wrap property - examples


You can try to execute the following code to change CSS word-wrap property of a text on this page.

Example:
Example 1, How to create CSS word-wrap property - examples:

  <!DOCTYPE html>
<html>
<head>
<title>How to create CSS word-wrap property - examples - example</title>
<style>
div {
width: 180px;
border: 2px solid #00FF00;
}
div.first_box {
word-wrap: normal;
}
div.second_box {
word-wrap: break-word;
}
</style>
</head>
<body>
<h1>The word-wrap Property</h1>
<h2>word-wrap: normal (this is default property)</h2>
<div class="first_box"> This div contains a very long word:
word-wrap: normal (this is default property) thisisablablarylongwordblarylongwordblarylongwordblarylongword.
The long word will break and wrap to the next line.</div>
<h2>word-wrap: break-word:</h2>
<div class="second_box"> This div contains a very long word:
will break and wrap - thisisablablarylongwordblarylongwordblarylongwordblarylongwordblarylongword.
The long word will break and wrap to the next line.</div>
</body>
</html>
Note: Use external CSS instead.


css text wrap, around div, ellipsis, in div, around image, responsive, around circle, white space, none, 2 lines
CSS Text Wrap - css tutorial

Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


CSS Scrollbar Horizontal
CSS Scrollbar in Div
CSS Scrollbar Firefox
CSS Style Scrollbar
CSS Style Text
CSS background color
CSS Div Id Class
CSS Text Wrap
CSS text-align
CSS Text Decoration
CSS Text Shadow
CSS Text Color
CSS Text Bold
CSS Text Size
CSS background image full
CSS background opacity
CSS border radius
CSS rounded corners
CSS font color
CSS Class & ID
CSS align image center
CSS align content
CSS link color
CSS Text Style
CSS Text Font Size
CSS max width &height
CSS width and height
CSS Margin
CSS Padding
CSS Border Style
CSS background
CSS in HTML
Basic Syntax of CSS
CSS Introduction
Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.