【问题标题】:CSS element will not become the width of the page when zoomedCSS 元素在缩放时不会变成页面的宽度
【发布时间】:2013-12-25 05:56:28
【问题描述】:

http://jsfiddle.net/aN57Q/1/

当我缩放我的页面时,一个元素最终会拉伸它,当它拉伸时,你会得到与上面 jsFiddle 中的情况非常相似的情况。

蓝色元素代表拉伸页面的元素,不可更改,其余为公平游戏。我需要红色框来适当地填充页面。

提前非常感谢!

<div class="a">A</div>
<div class="b">B</div>
<div class="c"></div>

<div class="somethingBig">Blah!</div>

div {
    height: 50px;
    background-color: red;
    margin-bottom: 10px;
    font-family: Verdana;
    color: white;
    font-size: 30px;
    line-height: 50px;
}

.a { width: 100%; }
.b { width: 100vw; }
.c { width: 100%; }

.somethingBig {
    width: 600px;
    background-color: blue;
}

【问题讨论】:

  • 您遇到了什么问题?我没有看到缩放有什么奇怪的地方。 “适当地”填写是什么意思?
  • 使用底部的滚动条,红色块没有填充到蓝色的末尾(右)!
  • * 放大时。

标签: css width viewport


【解决方案1】:

好的,这与浏览器窗口较小时发生的情况相同,因此红色条没有蓝色条宽。它们只走100%的身体,比溢出的蓝色还要小。

你可以在你的“div”CSS上做min-width:600px;。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-01-19
  • 2012-12-19
  • 2020-06-08
  • 2014-11-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多