An element can be floated to the right of a Web Page by assigning a right value to the float property. Let's create a web page , named floatright.html, to understand how an element is floated to the right of the Web Page.
<!DOCTYPE html>
<head><style type="text/css">
.fool {
float:right;
}
</style>
</head>
<body>
<h1>Floating an element to the right </h1>
<p>
<img class="fool" src="bike.jpg"/>
My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.
</p>
</body>
</html>
The Output of the above document is:
<!DOCTYPE html>
<head><style type="text/css">
.fool {
float:right;
}
</style>
</head>
<body>
<h1>Floating an element to the right </h1>
<p>
<img class="fool" src="bike.jpg"/>
My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.My paragraph.
</p>
</body>
</html>
The Output of the above document is:
No comments:
Post a Comment