html怎样设置整个页面尺寸

html-css07

html怎样设置整个页面尺寸,第1张

页面的现实的大小超过了浏览器窗口的可视范围,就会出现滚动条。

你要去掉页面的滚动条 两个方法:

1、放大浏览器的窗口

2、在页面中添加样式:

html,body{

overflow:hidden

height:100%

}

HTML:

<div class="nav">

<div class="nav_con">

<ul>

<li>首页</li>

<li>我的主页</li>

<li>他的主页</li>

<li>你的主页</li>

</ul>

</div>

</div>

CSS:

ul{ list-style:nonepadding:0margin:0}

body{ padding:0border:0margin:0}

.nav{ width:100%height:50pxbackground:#F00}

.nav_con{ width:1200pxheight:50pxmargin:auto}

.nav_con ul li{ float:leftpadding:0 15pxtext-align:centerheight:50pxline-height:50pxcolor:#FFFbackground:#960margin-right:1px}