• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 10. Text Properties > wrap-option Property

10.18. wrap-option Property

The wrap-option property is designed to provide direct control over how text should or should not wrap when it reaches the end of the line of the block it is contained within. This may seem rather odd at first, since you could argue that the same sort of thing could be accomplished using the <br> tag to arbitrarily truncate a line of text, but the wrap-option property tells the browser to be on the lookout for an imbedded linefeed character — specifically, the U+000A character block, which is typically used by text-editing programs to denote a line break. How the browser is to deal with the text that comes before and after this character depends on the value used.

The wrap-option property has six values: wrap, hard-wrap, soft-wrap and emergency, as well as the usual initial and inherit values. wrap, which is the default value, tells the browser to wrap the text in the target block at the best available opportunity to do so, using whatever settings for line-break and word-break may be present. As well, this value is to give priority in making a line break whenever an embedded linefeed character is encountered within the text. hard-wrap instead tells the browser to only wrap text when it encounters an embedded linefeed character. The soft-wrap value is similar to wrap, save for the fact that no line-breaking algorithm is invoked, so that it is entirely up to the browser to determine where to best break the line. The oddly named emergency value also works similarly to wrap, except that it is intended to break very long words that may appear within a line when ordinarily they would be constrained by the line-break or word-break properties — it essentially prevents a long word from awkwardly “protruding” from the end of a block of text. The initial value is a way of setting a property explicitly to its default value. The inherit value simply tells the property to take on whatever parent value may already be present.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint