Text Flow Control and Cursors
text-overflow Property
| Property | Usage and Effect | Values | Recommendations |
|---|---|---|---|
| text-overflow | Specifies what should occur when content goes outside of an element; ideally you indicate that content continues by using ellipsis. |
|
Useful in cases where width is limited and text is likely to be substantial; also bring in overflow and white-space. |
text-overflow Example
See the Pen Text-Overflow by Jason Withrow (@jwithrow) on CodePen.
word-wrap / overflow-wrap Properties
| Property | Usage and Effect | Values | Recommendations |
|---|---|---|---|
| word-wrap / overflow-wrap |
Wraps long words to the next line and adjusts spacing for other words so they do not break in the middle.
The specification also details certain behavior for Chinese, Japanese, and Korean (CJK) text when this is used. This property is helpful when content is forcing a scrollbar or breaking a column width, such as a lengthy spelled-out email address in a small column. |
|
Sometimes you have long spelled-out email addresses or file names in small areas of the layout; this property is very helpful in those cases.
|
word-wrap Example
See the Pen Word-Wrap / Overflow-Wrap by Jason Withrow (@jwithrow) on CodePen.
word-break Property
| Property | Usage and Effect | Values | Recommendations |
|---|---|---|---|
| word-break | Wraps characters to the next line when the width limit is reached, regardless of location within the word.
Has no special rules for Chinese, Japanese, and Korean (CJK) text. This property is helpful when content is forcing a scrollbar or breaking a column width, such as a lengthy spelled-out email address in a small column. |
|
This applies to similar scenarios as word-wrap / overflow-wrap. |
word-break Example
See the Pen Word-Break by Jason Withrow (@jwithrow) on CodePen.
white-space Property
| Property | Usage and Effect | Values | Recommendations |
|---|---|---|---|
| white-space | Determines how spaces in element content are rendered.
This property allows you to apply the special characteristics of the The code examples in these lectures use |
|
The difference between pre and pre-wrap is that pre content keeps going past the width of the container element, while pre-wrap causes wrapping once the width of the container element is reached. For this reason, pre-wrap is more flexible and is therefore preferable.
|
white-space Example
See the Pen White-Space by Jason Withrow (@jwithrow) on CodePen.
cursor Property
| Property | Usage and Effect | Values | Recommendations |
|---|---|---|---|
| cursor | Determines the cursor used when an element is moused over. |
|
Limited and thoughtful usage is recommended; you can really confuse a user with an inappropriate cursor.
The Multiple custom graphical cursors can be specified, separated by commas. Be sure to give a generic cursor as the last option, in case none of the others can be found or used. Custom cursors are typically in .cur file format; Gecko-based browsers also support .png and .gif Be careful of the |
cursor Example
See the Pen Cursors by Jason Withrow (@jwithrow) on CodePen.