我有几个div在我的代码,他们所有的位置正确我想要它。唯一的问题是,他们不缩小页面缩小时。我想要能够根据Web浏览器大小重新调整大小。我不知道怎么做,我担心它可能会弄乱他们正确的顶部&左位置。所有的div都设置为绝对定位。
解决方案我想出来了,基本上我做了什么宽度(让我们说它的300像素),并计算出页面宽度的百分比(在我的例子是1900像素)。 结果将是15.789473684210526%把确切的值工作就好了!像像素一样精确。 我使用这个工具:
www.onlineconversion/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:
www.onlineconversion/percentcalc.htm
Thank you all for your replies!
更多推荐
CSS Div根据Web浏览器调整大小
发布评论