Set width and height for paragraph : p layout « Tags « HTML / CSS






Set width and height for paragraph

     
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type='text/css'>
body {font-family:arial, verdana, sans-serif;}

.one, .two, .three {
  border:1px solid #000000; 
  margin:20px; 
  padding:10px;}

.one {
  width:300px;
  height:200px;}

.two {
  width:300px;
  height:50px;}

.three {
  width:20em;
  height:15ex;}
</style>


</head>

<body>
<p class="one">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. </p>
<p class="two">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. </p>
<p class="three">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. </p>
</body>
</html>

   
    
    
    
    
  








Related examples in the same category

1.Set width for a paragraph
2.p min-width: 500px;
3.p width:40em;
4.p width: 245px;
5.p line-height: 1em;
6.Set line height of a Paragraph in content section
7.p max-height: 50px;
8.p line-height: 3em;
9.p height: 245px;
10.p line-height: 2.0;
11.Paragraph with different line-height
12.This paragraph is floated left
13.p float:left;
14.p float:right;
15.p float: left;
16.P display: block;
17.p display:none;
18.p overflow: visible;
19.p overflow: auto;
20.p overflow: scroll;
21.p overflow: hidden;
22.p white-space: nowrap;
23.p white-space: pre;