html页面宽度 最小,HTML宽度100%超出页面范围

我是HTML和CSS的新手。所以,我有宽度100%的问题。它似乎超越了浏览器的边界。请看下面的例子!我应该减少每分钱的宽度还是我的代码中有一些可能导致这种情况的缺陷?

我在这里发现了一些关于宽度100%的其他帖子,但他们都没有真正帮助我。这是我做的例子:http://jsfiddle.net/gj53jbz9/

body{

font-size: 15px;

margin: 0px;

background-color: lightgrey; }

#header{

padding: 30px;

width: 100%;

height: 250px;

background-color: grey; }

#name{

padding: 5px;

font-size: 25px;

float: left; }

#navbar{

float: right;

text-align: right; }

#navbar a{

background-color: black;

display: inline-block;

width: 120px;

text-align: center;

padding: 10px 0px;

text-decoration: none;

color: lightgrey; }

#title{

clear: both;

text-align: center;

padding-top: 100px;

font-size: 45px; }

#content{

text-align: center;

width: 80%;

margin: 0px auto; }

Age of aggression

We drink to our youth, to days come and gone. For the age of aggression is just about done. We'll drive out the Stormcloaks and restore what we own. With our blood and our steel we will take back our home.

Down with Ulfric! The killer of kings! On the day of your death we will drink and we'll sing. We're the children of Skyrim, and we fight all our lives. And when Sovngarde beckons, every one of us dies! But this land is ours and we'll see it wiped clean. Of the scourge that has sullied our hopes and our dreams!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值