1.画三角形
.triangle1{
width: 0;
height: 0;
border-left: 100px solid aqua;
border-top: 50px solid transparent;
border-bottom: 50px solid transparent;
}
//加上css3的transform特性
.triangle2{
width: 0;
border-bottom: 35px solid lightgreen;
border-left: 35px solid transparent;
transform: rotate(-135deg);
}
//看到别人写的一种方式,初步测了一下,border左侧和右侧颜色设置的时候三角形的尖尖没有了,以后再好好研究【果然是学到的知识越多解决问题的方法就越多😄】
.triangle3:after{
content: "";
border: 35px solid transparent;
border-top-color: tomato;
}
2.借鉴百度首页设置背景图片
单独写一个div标签,用来设置背景图片
.bg{
background: url(img/bg.jpg);
position: fixed;
_position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
min-width: 1000px;
z-index: -10;
background-position: center 0;
background-repeat: no-repeat;
background-size: cover;
-webkit-background-size: cover;
-o-background-size: cover;
zoom: 1;
}
网友评论