如何设置margin-right在调整窗口大小时逐渐减小

时间:2014-08-20 13:10:27

标签: jquery css

当我在浏览器上调整窗口大小时,我想要响应margin-right

这是我的代码

HTML

<header id="header"><!-- ... --></header>
<aside id="block">
bolck bolck bolck bolck bolck bolck
bolck bolck bolck bolck bolck bolck
</aside>
<main id="content">
content here content here content here content here
content here content here content here content here

</main>

CSS

#header {
  height: 100px;
  border-bottom: solid 1px #ccc;
}
#block {
  margin-right: 200px;
  width: 250px;
  float: right;
  border-right: solid 1px #ccc;
  border-left: solid 1px #ccc;
}
#content {
  padding: 5px;
}

我希望在屏幕上设置margin-right在调整大小浏览器时逐渐减少

感谢所有

1 个答案:

答案 0 :(得分:-2)

尝试使用百分比作为保证金权利。玩弄它并找到最好的结果。

此处示例:

jsfiddle.net/jnh2dxak/1

相关问题