首页
极刻
圈子
教程
开源
登录 / 注册
返回教程:CSS 教程
TRY RUN / 在线示例
CSS 教程 为图像添加边框和边距并浮动到段落的右侧
CSS 教程 为图像添加边框和边距并浮动到段落的右侧
源代码
运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>安科教程(www.ancii.com)</title> <style> img { float:right; border:1px dotted black; margin:0px 0px 15px 20px; } </style> </head> <body> <p> 在下面的段落中,图像将向右浮动。黑色虚线边界添加到图像。 我们还添加了边缘的0 px的顶部和右侧 margin,15 px底部margin,和20 px左侧的margin的图像。使得文本远离图片:</p> <p> <img src="/attachments/cover/cover_css.png" width="95" height="84" /> 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>
运行结果