代码示例:(标识:css_float_2)
<!DOCTYPE html>
<html>
<head>
<style>
img {
  float: right;
  border: 1px dotted black;
  margin: 0px 0px 15px 20px;
}
</style>
</head>
<body>

<p>
在下面的段落中,图像将向右浮动。黑色的虚线边框被添加到图像。
我们还为图像添加了外边距以将文本推离图像:
图像的上、右外边距为 0px,下外边距为 15px,左外边距为 20px。
</p>

<p><img src="/static/demo/images/logo-1.png" width="188" height="267">
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
</p>

</body>
</html>
运行结果: