大一学的都忘记了,有机会重新学习一遍,简单记录下(小傻猫),日常
记录学习
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="../CSS/Top导航栏.css" type="text/css" rel="stylesheet">
<title>Document</title>
</head>
<body>
<div class="index">
<div class="header">页眉</div>
<div class="nav">
<a href="text1.html">主页</a>
<a href="#">音乐</a>
<a href="#">运动</a>
<a href="#">美食</a>
<a href="#">休闲</a>
</div>
</div>
</body>
</html>
CSS
*{
margin: 0;
padding: 0;
}
body{
background-color:white;
}
.header{
margin: 0 auto;
width: 100%;
height: 30px;
background-color: seashell;
text-align: center;
}
.nav{
margin: 0 auto;
width: 100%;
height: 40px;
background-color: lightblue;
font-size: 18px;
text-indent: 2em;
line-height: 2em; /*距离上边线的距离*/
text-align: justify;
}
a{
margin-right: 90px;/*超链接 相对于左右边的距离的设置 */
margin-left:100px;
font-size: 18px; /* 文字大小的设置 */
color:pink; /* 连接字体的颜色 */
text-decoration: none; /*消除掉超链接下面的横线*/
}
/* 未访问时的状态 ,访问过的状态 */
a:link,a:visited{
color: #333333;
}
/* 鼠标经过连接上的状态 */
a:hover{
color: lightgoldenrodyellow;
}
/* 鼠标点击连接的状态 */
a:active{
color: lightseagreen;
}
效果: