css word-break attribute


  Translation results:

word

英[wɜ:d] 美[wɜ:rd]

n. Word; Discourse; Promise; Message

vt .Wording, using words; expressing with words

vi.Speech

break

## English[breɪk] 美[brek]

vt. (make) break; break (record); (often refers to good weather) sudden change; start

vi.breakthrough; (voice) sudden change; dawn; (price) sudden drop

n.Rupture;intermediate rest;intermission;short vacation

css word-break attributesyntax

Function:The word-break attribute specifies the processing method of automatic line wrapping. Tip: By using the word-break attribute, you can let the browser break a line at any position.

Grammar: word-break: normal|break-all|keep-all

##Description: normal Use the browser default Newline rules. break-all allows line breaks within words. Keep-all can only break lines at half-width spaces or hyphens.​

Note: All major browsers support the word-break attribute.

css word-break attributeexample

<!DOCTYPE html>
<html>
<head>
<style> 
p.test1
{
width:11em; 
border:1px solid #000000;
word-break:hyphenate;
}
p.test2
{
width:11em; 
border:1px solid #000000;
word-break:break-all;
}
</style>
</head>
<body>
<p class="test1">This is a veryveryveryveryveryveryveryveryveryvery long paragraph.</p>
<p class="test2">This is a veryveryveryveryveryveryveryveryveryvery long paragraph.</p>
<p><b>注释:</b>目前 Opera 不支持 word-break 属性。</p>
</body>
</html>
Run instance »

Click the "Run instance" button to view the online instance

Popular Recommendations

Home

Videos

Q&A