
bootstrap在网页中添加图片的方式有两种:
一种是:通过<img>标签直接插入到html中
另一种是:通过css背景属性添加
居中方法:水平居中的text-align:center 和 margin:0 auto
概述
CSS2 中有5个主要的背景(background)属性,它们是:
* background-color: 指定填充背景的颜色。
* background-image: 引用图片作为背景。
* background-position: 指定元素背景图片的位置。
* background-repeat: 决定是否重复背景图片。
* background-attachment: 决定背景图是否随页面滚动。
多背景
新属性:背景修剪(background-clip)
新属性:背景原点(background-origin)
新属性: 背景尺寸(background-size)
新属性:(background-break)
背景色(background-color)的改进
背景平铺(background-repeat)的改进
背景附着(background-attachment)的改进
新属性:背景原点(background-origin)
这个属性和 background-position 结合起来使用。可以从边框,内补白或者内容盒子开始计算 background-position (类似于 background-clip)。
* background-origin: border-box;
以边框为原点开始计算 background-position.
* background-origin: padding-box;
以内补白为原点开始计算 background-position
* background-origin: content-box;
以内容盒子为原点开始计算 background-position
对于 background-clip 和 background-origin
相关推荐:bootstrap入门教程
以上就是bootstrap怎么添加背景图片的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号