简单教程
提交运行
代码编辑器:
<!DOCTYPE html> <meta charset="utf-8"><link href="/static/next/css/tryit.css?v=2017082407" rel="stylesheet"/> <style> div { border:1px solid black; padding:35px; background-image:url('/static/i/css3/smiley.gif'); background-repeat:no-repeat; background-position:left; } #div1 { background-origin:border-box; } #div2 { background-origin:content-box; } </style> <p>背景图像边界框的相对位置:</p> <div id="div1"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. </div> <p>背景图像的相对位置的内容框:</p> <div id="div2"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. </div> <footer>简单教程,简单编程<br/>Copyright © 简单教程 www.twle.cn</footer>
运行结果: