Gunakan text-overflow: ellipsis; white-space: nowrap; overflow: hidden; untuk memotong judul yang terlalu panjang secara rapi.
CSS Text Effects
Contoh Kode CSS Text Effects:
<!DOCTYPE html>
<html>
<head>
<style>
.judul-terpotong {
width: 250px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
border: 1px dashed #94a3b8;
padding: 8px;
font-family: sans-serif;
color: #0d2e5c;
}
</style>
</head>
<body>
<div class="judul-terpotong">
Judul Materi Sangat Panjang Sekali yang Tidak Muat Pada Satu Baris Kontainer
</div>
</body>
</html>
Uji dan amati bagaimana deklarasi CSS CSS Text Effects mengubah tampilan elemen di atas.