如何在bootstrap中使用css3中的响应背景图片 [英] How to use responsive background image in css3 in bootstrap

查看:148
本文介绍了如何在bootstrap中使用css3中的响应背景图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不想使用html标签。这是我的CSS。我使用bootstrap 3.0。

I dont want to use html tag. This is my css. I am using bootstrap 3.0.

background:url('images/ip-box.png')no-repeat;
background-size:100%;
height: 140px;
display:block;
padding:0 !important;
margin:0;

在100%缩放这是确定。但是当我在180%左右放大时,图像将从顶部和底部短,我想要一些CSS的技巧。

On 100% zoom this is OK. but when I zoom in at 180% approx, the image will be short from top and bottom, I want some css tricks.

推荐答案

对于完整图片背景,请检查:

For full image background, check this:

html { 
background: url(images/bg.jpg) no-repeat center center fixed; 
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}

这篇关于如何在bootstrap中使用css3中的响应背景图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆