CSS3 Word Break

<!DOCTYPE html>
<html>
<head>
<style type=“text/css”>
.word-break{
width: 500px;
border: 2px solid #ddd;
padding:10px;
word-break: break-word;
}
.word-break-all{
width: 500px;
border: 2px solid #ddd;
padding:10px;
word-break: break-all;
}
</style>
</head>

<body>
<p class=“word-break”> Pellentesque ornare, leo a suscipit hendrerit, massa tortor tempor eros, vitae aliquam dolor leo sit amet urna. Pellentesque ornare, leo a suscipit hendrerit, massa tortor tempor eros, vitae aliquam dolor leo sit amet urna. Pellentesque ornare, leo a suscipit hendrerit, massa tortor tempor eros, vitae aliquam dolor leo sit amet urna. Pellentesque ornare, leo a suscipit hendrerit, massa tortor tempor eros, vitae aliquam dolor leo sit amet urna. </p>

<p class=“word-break-all”> Pellentesque ornare, leo a suscipit hendrerit, massa tortor tempor eros, vitae aliquam dolor leo sit amet urna. Pellentesque ornare, leo a suscipit hendrerit, massa tortor tempor eros, vitae aliquam dolor leo sit amet urna. Pellentesque ornare, leo a suscipit hendrerit, massa tortor tempor eros, vitae aliquam dolor leo sit amet urna. Pellentesque ornare, leo a suscipit hendrerit, massa tortor tempor eros, vitae aliquam dolor leo sit amet urna. </p>
</body>

</html>

RESULT:

css-3-word-break




Leave a Reply

avatar
  Subscribe  
Notify of