When you're designing a web page, you might want to wrap text around an image to create an engaging layout. HTML5 makes this task quite straightforward with the `

The `

Basic Syntax to Wrap Text Around an Image
The most basic syntax for wrapping text around an image using the `

Here's a simple example:
In this example, the image is floated left, and the caption appears next to the image. You can adjust the `margin-right` style of the `

Aligning Text Around the Image
To make the text flow more naturally around the image, you can use the `
Here's how you can do it:

This is a paragraph of text that wraps around the image.
You can add as much text as you like, and it will flow around the image.
Clearing the Float

After using the `float` CSS property, it's important to clear the float to prevent other elements from collapsing into the floated element. This can be achieved using the `
Here's how the complete code should look:




















This is a paragraph of text that wraps around the image.
You can add as much text as you like, and it will flow around the image.
This ensures that the following elements on the page will not collapse into the floated image and text.
Responsive Design
In responsive design, it's crucial to consider how your layout will look on different screen sizes. To make your wrapped text around image layout responsive, you can use media queries to adjust the placement and style of the image and text as the screen size changes.
For instance, you might want to make the image full-width on small screens and float it to the left on larger screens. You can achieve this using media queries to adjust the CSS `float` and `width` properties of the `
Media Queries for Responsive Design
Here's an example of how you might use a media query to make your wrapped text around image layout responsive:
This is a paragraph of text that wraps around the image.
You can add as much text as you like, and it will flow around the image.
In this example, the image is full-width on screens smaller than 600px, and it's floated left on larger screens.
With these techniques, you can create engaging and responsive web pages that wrap text around images, thanks to the guidance provided by w3schools.