Width in CSS
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.
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.
.container {
background: pink none repeat scroll 0 0;
width: 960px;
}
max-width and min-width are used for responsive :
.container {
background: pink none repeat scroll 0 0;
max-width: 960px;
}
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment