html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!DOCTYPE html>
<html>
<body>
<p><strong>Float the image to the right:</strong></p>
<p>
<img src="https://www.sololearn.com/images/fb-story-icon.jpg" alt="Sololearn" style="float:right;width:50px;height:50px;">
A paragraph with a floating image to the right. A paragraph with a floating image to the right. A paragraph with a floating image to the right.
</p>
<hr>
<p><strong>Float the image to the left:</strong></p>
<p>
<img src="https://www.sololearn.com/images/fb-story-icon.jpg" alt="Sololearn" style="float:left;width:50px;height:50px;">
A paragraph with a floating image to the left. A paragraph with a floating image to the left. A paragraph with a floating image to the left.
</p>
<hr>
<p><b>Remember to use the CSS float property as the align attribute is not supported in HTML5.</b></p>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
body {
}
Enter to Rename, Shift+Enter to Preview
js
js
1
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run