header{
text-align:center;
background:url(“/assets/jeff-bg.png”);
background-size:cover;
color:white;
}
a{
color:white;
text-decoration:none;
height:30px;
line-height:30px
}
a:hover{
background-color:#eb3f2f}
h1{
font-size:70px;
}
img{
margin:40px 0px 0px 0px;
border:7px solid white;
border-radius:20px;
}
ul{
padding:10px;
background-color:rgba(0,0,0,0.4);
}
li{
display:inline;
padding:0px 10px 0px 10px;
}
Jeff’s Blog
效果图:
- 要设置某一元素的背景为透明,在 chrome 、firefox、opera 下是这样的:
background-color: rgba(0, 0, 0, 0.4);
rgba 中的最后一个参数 0.4 就是想要的透明度,范围在0~1之间。
在 ie 中一般是这样的:
opacity 表示透明度,它的值范围在 0~100 之间
background-color: rgb(0, 0, 0);
filter: alpha(opacity=40);
要兼容不同浏览器可以把两段代码都写上去
2、用border-radius属性来设置边框边缘弧角设置