Set width to 250px in HTML and CSS

Description

The following code shows how to set width to 250px.

Example


<!--   www.  j a  v a 2  s . c om-->




<html>
<head>

<style type='text/css'>
p {
margin: 10px;
padding: 10px;
color: black;
border: thin solid;
width: 250px;
top: 100px;
line-height: 3em;
font-size: 1em;
}
</style>
</head>
<body>
<p>
this is a test. this is a test. this is a test. this is a test.
this is a test. this is a test. this is a test. this is a test.
this is a test. this is a test. this is a test. this is a test.
</p>
</body>
</html>


]]>
</code>

Click to view the demo

The code above generates the following result.

Set width to 250px in HTML and CSS