HTML Floating Elements

Floating an Element :-

An element can be floated to the right or left of a web page.You can also disable the floating effect of an HTML element by using the CSS property, clear. The clear property uses the left value to disable the effect of left  floated element and the right value to disable the effect of right floated element.

 

Example of HTML Floating Elements an Element to the Right :-

 

<Html>
<Head>
<style>

.f1
{
float:right;

}
</style>
</Head>
<body>
<h1>HTML Floating Elements an Element to Right</h1>
<p><img class="f1" src="floatright.jpg" width="150" height="200">
I am working on Float an Element to the Right.
I am working on Float an Element to the Right.I am working on Float an Element to the Right.I am working on Float an Element to the Right.I am working on Float an Element to the Right.I am working on Float an Element to the Right.I am working on Float an Element to the Right.I am working on Float an Element to the Right.I am working on Float an Element to the Right.I am working on Float an Element to the Right.
I am working on Float an Element to the Right.I am working on Float an Element to the Right.I am working on Float an Element to the Right.
I am working on Float an Element to the Right.
I am working on Float an Element to the Right.
I am working on Float an Element to the Right.
</p>

</body>
</html>

 

Result :-

 

Floating an Element in HTML

 

The image is floated to the right and the paragraph is wrapped to provide an appearance  similar to a block.




Follow Us

Contact Us

tutorialworldin@yahoo.com

Back to Top