Home >Web Front-end >CSS Tutorial >Can HTML/CSS Wrap Text Around an Image?

Can HTML/CSS Wrap Text Around an Image?

Linda Hamilton
Linda HamiltonOriginal
2024-12-07 21:40:18885browse

Can HTML/CSS Wrap Text Around an Image?

Wrap Text Around Image with HTML/CSS

Problem:

Designing a text block that wraps around an image like the following:

[Image of text wrapping around an image]

Query:

Is this possible with HTML/CSS?

Solution:

Float the image container using the following code:

<div>

CSS:

#container{
    width: 400px;
    background: yellow;
}
#floated{
    float: left;
    width: 150px;
    background: red;
}

Example:

[Link to JSFiddle demo]

The above is the detailed content of Can HTML/CSS Wrap Text Around an Image?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn