【问题标题】:How to make a fullscreen image on bootstrap?如何在引导程序上制作全屏图像?
【发布时间】:2016-04-24 01:15:21
【问题描述】:

这里是一个例子:https://ironsummitmedia.github.io/startbootstrap-stylish-portfolio/

在示例中,背景登录页面填充了视口的宽度,不占用整个页面的宽度,并且是响应式的。你如何使用 bootstrap 手动编码这样的图像?

【问题讨论】:

标签: html css twitter-bootstrap-3


【解决方案1】:

你用这个来填充标签:

-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;

【讨论】:

    【解决方案2】:

    基于这个article,你只需要定义一个带有id的div,然后像这样把图片放在里面:

     <div id="bg">
        <img src="yourimg.jpg" alt="">
      </div>
    

    然后给出这个样式:

    #bg {
      position: fixed; 
      top: 0; 
      left: 0; 
    
      /* Preserve aspet ratio */
      min-width: 100%;
      min-height: 100%;
    }
    
    
    .back {
      /* Set rules to fill background */
      min-height: 100%;
      min-width: 1024px;
    
      /* Set up proportionate scaling */
      width: 100%;
      height: auto;
    
      /* Set up positioning */
      position: fixed;
      top: 0;
      left: 0;
    
    }
    

    这应该可以解决问题。 你可以看到这个并播放here (要全屏查看,只需点击“Auto-run js”旁边右上角的箭头)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-01-28
      • 1970-01-01
      • 2017-06-17
      • 1970-01-01
      • 2018-08-16
      • 2019-10-25
      • 2015-09-22
      相关资源
      最近更新 更多