A Way For Learning

Width in CSS

No comments
Width :
Width is set to the area in which is to be written.
width can be set in terms of pixels and percentages.

<!DOCTYPE html>
<html>
<head>
<title>Sample</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="container">
<p>Hi,This is a sample test!</p>
</div>
</body>
</html>

.container{
 width: 960px;
}

in the above example width is set to 960 pixels.
Width can be auto.In auto,complete screen width is occupied.

Add a background colour for the above container to know the width.

No comments :

Post a Comment