Set that text in the <p> element to wrap, even if it needs to split in the middle of a word. - HTML CSS CSS

HTML CSS examples for CSS:Quiz

Description

Set that text in the <p> element to wrap, even if it needs to split in the middle of a word.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
p {<!--from  w  ww. j a  v  a2s  .  com-->
    width: 150px;
    border: 1px solid #000000;
    word-wrap: break-word;
}
</style>
</head>
<body>

<p>This paragraph contains a very long word: asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfa.</p>

</body>
</html>

Related Tutorials