Set width and height for paragraph in HTML and CSS

Description

The following code shows how to set width and height for paragraph.

Example


<html>
<head>
<!--   w  w w  .  j  av a 2  s. c  o m-->
<style type='text/css'>
p {
border: thin solid black;
text-align: justify;
width: 150px;
height: 150px;
}

</style>
</head>
<body>
<p>
Peter Piper picked a peck of pickled peppers.
Did Peter Piper pick a peck of pickled peppers?
If Peter Piper picked a peck of pickled peppers,
where's the peck of pickled peppers Peter Piper picked?
</p>
</body>
</html>

Click to view the demo

The code above generates the following result.

Set width and height for paragraph in HTML and CSS