CSS Div根据Web浏览器调整大小 [英] CSS Div re-sizing according to web browser

查看:405
本文介绍了CSS Div根据Web浏览器调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个div在我的代码,他们所有的位置正确我想要它。唯一的问题是,他们不缩小页面缩小时。我想要能够根据Web浏览器大小重新调整大小。我不知道怎么做,我担心它可能会弄乱他们正确的顶部&左位置。所有的div都设置为绝对定位。

解决方案

我想出来了,基本上我做了什么宽度(让我们说它的300像素),并计算出页面宽度的百分比(在我的例子是1900像素)。
结果将是15.789473684210526%
把确切的值工作就好了!像像素一样精确。
我使用这个工具:



http://www.onlineconversion.com/percentcalc.htm



感谢您的回复! / p>

I have a few divs on my code all of them positioned correctly how i want it. The only problem is that they do not re size when i shrink the page. I want to be able to re size them according to the web browsers size. I do not know exactly how to do it and im worried it might mess up their correct top & left position. All of my divs are currently set as absolute positioning.

解决方案

I figured it out, basically what i did what get the width (lets say it's 300 pixels) and figure out the percent of the page width (in my case is 1900 pixels). The result would be 15.789473684210526% putting that exact value worked just fine! As accurate as a pixel. I used this tool:

http://www.onlineconversion.com/percentcalc.htm

Thank you all for your replies!

这篇关于CSS Div根据Web浏览器调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆