Saturday, August 17, 2013

CSS align center

<html>
<head>
<style type="text/css">
.center
{
margin:auto;
width:70%;
background-color:#b0e0e6;
}
</style>
</head>

<body>
<div class="center">
<p>Rice is normally grown as an annual plant, although in tropical areas it can survive as a perennial and can produce a ratoon crop for up to 20 years.</p>
<p>The rice plant can grow to 1–1.8 m tall, occasionally more depending on the variety and soil fertility.</p>
</div>
<p><b>Note: </b>Using margin:auto will not work in Internet Explorer. See the next step in the tutorial for a crossbrowser fix.</p>
</body>
</html>

Result


No comments: