我正在关注webdesign tutsplus的一个教程,最终页面: http ://webdesigntutsplus.s3.amazonaws.com/126_RibbonNavTutorial/code/demo_css_ribbon.html
我已经完成了一切,但是一个问题是html样式,你可以看到我已经包括高度:100%,但在原始教程中没有那条线,如果我删除那条线然后它崩溃了,但在原始教程中它是完美,为什么呢?
而且现在我已经完成了高度:100%然后你可以在底部滚动并且可以看到底部留有一个边距,我希望该图像粘在页面的最底部。
请下载图片以便您可以尝试此代码,以下是图片链接:
代码:
html{
background:#77d5fb url('bottom_bg.jpg') bottom center no-repeat;
height:100%;
}
body{
background:transparent url('top_bg.png') top center no-repeat;
height:100%;
width:100%;
margin:0 0;
}
#container{
width:900px;
margin:0 auto;
}
#navBar{
height:62px;
background-color:#e5592e;
margin:3em 0;
position:relative;
-webkit-box-shadow:0px 0px 4px rgba(0,0,0,0.55);
box-shadow:0px 0px 4px rgba(0,0,0,0.55);
-moz-box-shadow:0px 0px 4px rgba(0,0,0,0.55);
-o-box-shadow:0px 0px 4px rgba(0,0,0,0.55);
border-radius:3px;
z-index:500;
}
#menu li{
list-style-type:none;
display:block;
float:left;
margin:1em 0.8em;
}
#menu li a{
display:block;
text-decoration:none;
color:#F0F0F0;
font-size:1.6em;
margin:0;
line-height:28px;
text-shadow:0 2px 1px rgba(0, 0,0, 0.5);
}
#menu li a:hover{
/*transition:margin-top 0.3s;
-webkit-transition:margin-top 0.3s;*/
margin-top:2px;
}
#lt-corner{
width:0px;
height:0px;
border:50px solid;
border-color:#d9542b transparent transparent;
position:relative;
float:left;
top:1px;
left:-50px;
}
#lb-corner{
border:50px solid;
border-color:transparent transparent #d9542b;
width:0px;
height:0px;
position:relative;
float:left;
top:-40px;
left:-150px;
}
#rt-corner{
width:0px;
height:0px;
border:50px solid;
border-color:#d9542b transparent transparent;
position:relative;
float:right;
top:-107px;
right:-45px;
}
#rb-corner{
border:50px solid;
border-color:transparent transparent #d9542b;
width:0px;
height:0px;
position:relative;
float:right;
top:-149px;
right:-145px;
}