编辑你的代码:
<!DOCTYPE html> <html> <body> <p> <img src="/static/images/smiley.gif" alt="Smiley face" style="float:left" width="42" height="42"> A paragraph with an image. The image will float to the left of this text. </p> <p> <img src="/static/images/smiley.gif" alt="Smiley face" style="float:right" width="42" height="42"> A paragraph with an image. The image will float to the right of this text. </p> <p><b>Note:</b> Here we have used the CSS "float" property to align the image; as the align attribute is deprecated in HTML 4, and is not supported in HTML5.</p> </body> </html>
查看结果:
phpxuexi.net
- 亲自试一试