Giới thiệu
Sử dụng thuộc tính word-wrap để ngắt dòng và-wrap sang dòng tiếp theo. Ví dụ triển khai word-wrap trong CSS:
Ví dụ
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 200px;
border: 2px solid #000000;
}
div.b {
word-wrap: break-word;
}
</style>
</head>
<body>
<h2>word-wrap: break-word</h2>
<div class="b"> ThisisdemotextThisisdemotext: thisisaveryveryveryveryveryverylongword. Từ dài sẽ-wrap sang dòng tiếp theo.</div>
</body>
</html>
Kết quả
