如何适应屏幕高度?

时间:2016-05-15 05:01:15

标签: html5 css3

我正在尝试将这个响应式网页设置为浏览器高度(没有垂直滚动),我很困惑。所有工作和不玩都会让杰克成为一个沉闷的男孩。所有工作和不玩耍都会让杰克成为一个沉闷的男孩所有工作和不玩耍都会让杰克成为一个沉闷的男孩所有工作和不玩耍都会让杰克成为一个沉闷的男孩

HTML:

  <header class="mainHeader">
  <a href="/home/show">
    <img src="/assets/EagleLogo.png" alt="" />
  </a>
    <nav>
      <ul>
        <li><a href="/products/supertherm" class="hvr-underline-from-center">SuperTHERM<sup>®</sup></a></li>
        <li><a href="/products/rustgrip" class="hvr-underline-from-center">RustGRIP<sup>®</sup></a></li>
        <li><a href="/products/hotpipe" class="hvr-underline-from-center">Hot-PIPE<sup>®</sup></a></li>
      </ul>
      <div class="search"><a href="#"><img src="/assets/mg.png" alt="" /></a>
      </div>
      <div class="product-inventory"><a href="/products/index"><img src="/assets/inventory.png" alt="" /></a>
      </div>
    </nav>
  </header>

<hr>

  <div class="mainContent-container">
    <img class="thermal" src="/assets/thermal.png" alt="" />
    <img class="corrosion effect2"src="/assets/co.png" alt=""/>
    <img class="fire effect2"src="/assets/fire.png" alt="" />
       <p class="intro"></p>
  </div>

  <img src="/assets/phone.png" alt="" height="75px" width="75px" align="middle" />

  <footer class="mainFooter">  </footer>

CSS:

.mainHeader img {
width: 30%;
height: auto;
}

.mainHeader nav {
height: 40px;
margin-top: -4%;
text-align: center;
}

div.mainContent-container {
// width: 80%;
margin: 3% 10% -3% 10%;
position: relative;
list-style: none;

.intro {
padding: .1% 1% 0 1%;
margin-top: 1%;
width: 95%;
text-align: center;
font-size: 1.5em;
font-family: 'Raleway';
font-weight: 500;
}

img[src="/assets/phone.png"] {
margin: 3.5% 46.9% 4% 46.9%;
}

.mainFooter {
 margin: 0 0 5% 28.3%;
}

1 个答案:

答案 0 :(得分:2)

  

所有工作和不玩都会让杰克成为一个沉闷的男孩。所有工作和不玩耍都会让杰克成为一个沉闷的男孩所有工作和不玩耍都会让杰克成为一个沉闷的男孩所有工作和不玩耍都会让杰克成为一个沉闷的男孩。

这一定是我读过的最令人困惑的说法。

至于你的问题,之前已经多次回答。

此外,它可能不是非常敏感,使所有东西都适合高度,相反,你应该专注于宽度。

例如,拿一个水平翻转的手机,会过度挤压设计。

如果你坚持......

html,body{height:100%;margin:0 0;padding:0 0;}
相关问题