English 中文(简体)
• 如何通过在社会保障局使用百分比来计算四舍五入
原标题:How to make div scalable by using percentage in CSS
  • 时间:2012-04-15 14:58:41
  •  标签:
  • html
  • css

然而,我对可扩展的四分五裂有一个问题。 我知道,我们可以做这样的事情。

<pre>
    <code>
        img {
            width: 100%;
            height: 98%;
        }
    </code>
</pre>

这将使图像在改造窗户时能够变换。 但我如何在平原四处发挥同样的作用? 我也想具体指出母子和女胎。 因此,我希望四舍五入到四舍五入到四舍五入到四舍五入的四分之四,但当窗户重新铺面时,需要能够将其大小反映到窗户上。 然而,当我做这样的事情时,我就这样说了。

<pre>
    <code>
    div {
        min-width: 450px;
        min-height: 300px;
        width: 100%;
        height: 100%;
    }
    </code>
</pre>

它不像我怀疑所有浏览者那样工作。 请建议我解决这一问题。

Updated Here is my code example http://jsfiddle.net/noppanit/Xfpp7/

我想要做的是,必须把“Some text”四分五裂,其大小与形象相同,无论形象如何大。 当你转播窗口时,“Some Text”缩小或以与图像相同的速度增长。 无法肯定这一点在安乐施会的光彩中是可能的。 感谢很多。

最佳回答

• 两个潜在问题:

  • You have a typo in your min-height
  • Did you specify the height of the container of the div too? For instance, if the div is directly in body, you must give the body a specific height, of the browser won t know what it is.

Edit:
To answer your comment, if you want the div to be 450 pixels wide on large screens, but to shrink when the screen is smaller, you need max-width instead of min-width.

问题回答

暂无回答




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签