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  w  w  . j a  v a 2s  . c  o m-->
    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