Run

Tutorial With Example

Run your live code

 
20
 
1
<!DOCTYPE html>
2
<html lang="en">
3
<head>
4
<meta charset="utf-8">
5
<title>Example of Floating Elements</title>
6
<style>
7
    img {
8
        float: left;
9
        width: 150px;
10
        height: 150px;
11
        margin-right: 20px;
12
    }
13
</style>
14
</head>
15
<body>
16
    <p><img src="/assets/example-image/border.png" alt="Border Image"> The floated element is removed from the regular flow and moved to the containing element's left or right side as far as possible in the available space.
17
​
18
 Other elements normally flow around the floated elements unless a clear property prevents them from doing so. Elements can be floated only horizontally, implying that an element can only be floated either left or right and not up or down.</p>
19
</body>
20
</html>