How to wrap long lines without spaces in HTML? "word-wrap:normal | break-word;"

Posted: December 28, 2012 in Articles, CSS, Resources, Tutorials

How to wrap long lines without spaces in HTML?

How to break long urls without spaces in span?

WORD WRAP CSS:
word-wrap: normal | break-word
 

Syntax

word-wrap: normal|break-word;

Description:

This property specifies whether the current rendered line should break if the content exceeds the boundary of the specified rendering box for an element (this is similar in some ways to the ‘clip’ and ‘overflow’ properties in intent.) This property should only apply if the element has a visual rendering, is an inline element with explicit height/width, is absolutely positioned and/or is a block element.

Examples

div { word-wrap: break-word }
<div style=”word-wrap: break-word”>Here is some content for the div element</div>
Value Description
normal Break words only at allowed break points
break-word Allows unbreakable words to be broken

Javascript Syntax:

object.style.wordWrap=”break-word”

Example

Issue in ie ?  Issue with SPAN tag ? Anchor tag?

Add display :block; property to style to fix the ISSUE:: ENJOY..

Reference: http://www.css3.com/css-word-wrap/
About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s