Monday 24 December 2012

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


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>

ValueDescription
normalBreak words only at allowed break points
break-wordAllows 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/
http://www.css3.com/css-word-wrap/



No comments:

Post a Comment