内容和 div 溢出滚动条之间的边距 [英] margin between content and div overflow scrollbar
问题描述
我使用以下代码来保持菜单项固定,同时允许滚动内容,因为它似乎是所有浏览器中最稳定的方法.
I am using the following bits of code to keep my menu items fixed while allowing for the scrolling of content because it seems to be the most stable method across all browsers.
body { overflow: hidden; }
div.content { height: 100%; overflow: auto; }
我的问题很简单,但我似乎无法弄清楚,标签内的内容与 div 区域的滚动条对接,这使阅读变得更加困难.如何在它们之间获得边距(除了将透明图像向右浮动以创建空间之外,还必须有更好的方法)?
My problem is simple, and yet I can not seem to figure it out, the content inside the tag butts up against the scrollbar for the div area and it makes reading much more difficult. How can I get a margin between them (apart from floating a transparent image to the right to create space, there HAS to be a better way)?
推荐答案
div.content { height: 100%; overflow: auto; margin:0 15px }
我可能误解了你,如果我有的话,请发布一些 HTML.
I might have misunderstood you though, post some HTML if I have.
这篇关于内容和 div 溢出滚动条之间的边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!