老师 您看下我的代码有什么问题吗,logo和文字部分定位的方式有需要改进的吗?
来源:2-2 编程练习
慕粉3924036
2019-12-29 17:50:35
*{
margin: 0;
padding: 0;
font-family: Arial;
color: aliceblue;
}
a{
text-decoration: none;
}
header{
height: 80px;
background: black;
opacity: 0.8;
}
header > .content{
width: 1000px;
margin: 0 auto;
}
header > .content > .logo{
/*width: 200px;*/
/*height: 70px;*/
/*border: antiquewhite solid 2px;*/
position: absolute;
}
header > .content > .logo a{
float: left;
display: block;
margin: 20px 10px;
}
header > .content > .logo p{
float: left;
/*line-height: 75px;*/
position: absolute;
left: 56px;
top: 40px;
font-size: 20px;
}
header > .content > nav{
float: right;
/*height: 73px;*/
}
header > .content > nav a{
display: block;
float: left;
width: 65px;
height: 73px;
line-height: 80px;
text-align: center;
/*border: aqua solid 1px;*/
}
header > .content > nav a:nth-child(1){background-color: #032165;}
header > .content > nav a:nth-child(2){background-color: #265999;}
header > .content > nav a:nth-child(3){background-color: #333333;}
header > .content > nav a:nth-child(4){background-color: #502323;}
header > .content > nav a:nth-child(5){background-color: #632572;}
header > .content > nav a:nth-child(6){background-color: #123456;}
header > .content > nav a:hover,
header > .content > nav a.active{
padding-bottom: 7px;
}
1回答
同学你好,只有css代码老师是测试不出来效果的,建议同学将完整的代码粘贴上来,老师才能测试效果。
如果我的回答帮助到了你,欢迎采纳,祝学习愉快~
相似问题