【问题标题】:Css positioning of parent and child elements父子元素的css定位
【发布时间】:2014-02-21 17:57:58
【问题描述】:

请试试这个我已经更详细解释问题的网址:Make division image responsive

我想让 .slider-wrapper 的宽度为 100%。如何更改 css 的其他组件?
CSS:

 .slider-wrapper { 
     width: 310px; 
     height: 650px;
     background: url("images/iPhone.png") center center ;
     background-size:cover;
    }

    .nivoSlider {
      position:relative;
      width:290px;
      height:512px;
      top:60px;
      bottom:65px;
      left:23px;
      right:24px;
      overflow: hidden;
    }
    .nivoSlider img {
      position:absolute;
      top:0px;
      left:0px;
      width:100%;
      height: 100%
    }

html:

<div class="slider-wrapper ">
    <div id="slider" class="nivoSlider">

    <img src=""  />
    <img src=""  />
    </div>
    </div>

图片:

如果您能帮助我,我将不胜感激。

【问题讨论】:

    标签: html css twitter-bootstrap


    【解决方案1】:

    你可以像这样使用 !important

    .nivoSlider {
          position:relative;
          width:290px !important;
          height:512px;
          top:60px;
          bottom:65px;
          left:23px;
          right:24px;
          overflow: hidden;
        }
    

    或者你必须像这样更好地定义它

    .nivoSlider slider-wrapper {
          position:relative;
          width:290px;
          height:512px;
          top:60px;
          bottom:65px;
          left:23px;
          right:24px;
          }
    

    【讨论】:

    • 您必须在没有 * 的情况下键入它
    • .slider-wrapper 怎么样,我应该将宽度更改为 100%
    • 看看网站oneapptheme.github.io。当低于 380 像素时,例如在 iPhone 上,图像足够大,我希望所有分区的图像变小并占据 100% 的宽度。打开380px以下的网站。你会得到它
    • 回答问题,我给你赏金
    • 用手机打开网站就可以了
    猜你喜欢
    • 2018-04-12
    • 1970-01-01
    • 2020-10-06
    • 2015-04-03
    • 2021-06-13
    • 2015-09-08
    • 2014-10-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多