CSS宽度/高度像素和百分比计算combintaion? [英] CSS width/height pixel and percentage calculation combintaion?
本文介绍了CSS宽度/高度像素和百分比计算combintaion?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有一种方法可以设置高度/宽度的CSS属性为这样的:100% - 50px
所以如果总100%是1000px,那么最终结果将是950px。而且100%是由浏览器大小设置的。
Is there a way to set the height/width CSS properties to something like that: 100% - 50px So if the total 100% is 1000px, then the end result would be 950px. And the 100% is set by the browser size.
更新:
我想做的是:
UPDATE: What I'm trying to do is:
我有两个div,第一个div的高度是50px,我想第二个div的高度覆盖剩余的空间。
I have two div, the first div's height is 50px, I would like the second div's height to cover the remaining space.
推荐答案
通过网络搜索后,我意识到它不能做。
模拟的唯一方法是使用JavaScript和 onresize
事件调整它。
After search though the net, I realized that it can't be done.
The only way to simulate is to adjust it with JavaScript and onresize
event.
这篇关于CSS宽度/高度像素和百分比计算combintaion?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文