如何使页面始终具有顶部和底部的页边距? [英] how to make page always margins with top and bottom?

查看:103
本文介绍了如何使页面始终具有顶部和底部的页边距?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我在使用CSS时遇到问题:在html中,我希望我的网站在滚动页面时始终始终保持顶部和底部距离为30px的边距.怎么做?请帮帮我.(我只对英语有一点了解)

hi all, i have a problem with css : in html i want my site always margins with top and bottom distances is 30px when scrolling page. How to make it? Please help me.(I just know a little about english)

推荐答案

使用CSS在body元素上设置边距
Use CSS to set the margins on the body element


可能您需要 IFRAME

尝试自定义此代码以满足您的需求:
http://www.dynamicdrive.com/dynamicindex17/iframescroll_dev.htm [
May be you need IFRAME

try to customize this code to fulfill your needs :
http://www.dynamicdrive.com/dynamicindex17/iframescroll_dev.htm[^]

The content of IFRAME is rest in another file , so place the center content in that file.

EDIT : As you mentioned that you want to use browser scroll bar the only way that remains is using a very old html tag which is frameset

try making a HTML file like this :
<html>

<frameset rows="25%,50%,25%">

  <frame src="frame_a.htm" />
  <frame src="frame_b.htm" />
  <frame src="frame_c.htm" />

</frameset>

</html>



如果frame_b的内容很大,那么浏览器将向其中添加滚动条,并且我确保它是浏览器自己的滚动条;)如果您希望隐藏边框,请尝试研究一下框架集.

但是我记得几年前他们说过不要使用框架集,因为我们将来不会支持它们,但是我仍然看到它们支持它们!

希望这会有所帮助.



if the content of frame_b is large then the browser will add a scroll bar to it and I ensure you that it is browsers own scrollbar ;) if you want the borders to be hidden, try to research about the framesets.

But I remember that several years ago they said that do not use framesets because we are going to not to support them in the future, but I still see that they support them!

Hope this helps.


这篇关于如何使页面始终具有顶部和底部的页边距?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆