我必须使用
position: relative
为了在出现溢出时出现滚动条(使用固定位置时滚动条显然不起作用)。
但是通过使用相对,我的内联块将出现在页面的中间,我无法在每个屏幕尺寸上将它定位在右侧30px。对此有什么解决方案吗?
我的代码现在:
#main_wrap
{
min-height: 100%;
background: url(images/content_back.png) repeat-y top left;
margin: 0 0 0 240px;
position: relative;
}
#main
{
position: relative;
width: 680px;
padding: 0 40px 5px 40px;
font: normal 14px Verdana, Arial, sans-serif;
line-height: 20px;
display: inline-block;
z-index: 2;
}
我可以使用的另一种解决方案是在使用固定位置时可以使用滚动条。
也许是一个愚蠢的问题,但我对这个主题没有经验:)提前感谢!