Tsallaka zuwa abun ciki
Justice Tech School

Image as a Link and Floating Images

Put an img inside an anchor to make a clickable image. The CSS float property wraps text around an image.

Example
<style>img { float: left; margin: 0 12px 6px 0 }</style>
<a href="#x"><img alt="Box" width="80" height="80" src="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2780%27 height=%2780%27%3E%3Crect width=%2780%27 height=%2780%27 fill=%27%23f59e0b%27/%3E%3C/svg%3E"></a>
<p>Text wraps around the floated image on the right side because the float property pushes the image left.</p>

Exercise

Float an image left.

float: ;

Quiz Test

What does float do to an image?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.