Thuộc tính gạch nối được sử dụng để chỉ định cách các từ được gạch nối khi văn bản bao quanh nhiều dòng. Nó có các giá trị sau -
Dấu gạch nganghyphens: none|manual|auto|initial|inherit;
Ví dụ
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 50px;
border: 2px dashed red;
}
.demo {
-webkit-hyphens: manual;
-ms-hyphens: manual;
hyphens: manual;
}
</style>
</head>
<body>
<h1>Demo Heading</h1>
<h2>hyphens: manual property value</h2>
<div class="demo">This is a demo text.</div>
</body>
</html> Đầu ra
Ví dụ
Bây giờ chúng ta hãy xem một ví dụ khác -
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 50px;
border: 2px dashed red;
color: blue;
}
.demo {
-webkit-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
}
</style>
</head>
<body>
<h1>Demo Heading</h1>
<h2>hyphens: auto property value</h2>
<div class="demo">This isssssss a demo text.</div>
</body>
</html> Đầu ra