摘要:<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>百度一下,你就知道</title> <link rel="stylesheet" type="text/c
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>百度一下,你就知道</title> <link rel="stylesheet" type="text/css" href="css/index.css"> </head> <body> <div class="header"> <div class="header_content"> <a href="">新闻</a> <a href="">hao123</a> <a href="">地图</a> <a href="">视频</a> <a href="">贴吧</a> <a href="">学术</a> <a href="">登录</a> <a href="">设置</a> </div> </div> </body> </html>> *{margin: 0px;padding: 0px;} .header{width: 100%;height: 40px;background: #F5F5F5;} .header_content{width:400px;height: 40px;float: right;} .header_content a{display:inline-block;text-align: center;} .header_content a:hover{color: blue;}
老师,为什么我的文字总在div的顶部,如何上下居中呢?多谢
批改老师:灭绝师太批改时间:2018-11-08 10:11:20
老师总结:添加行高 line-height属性就可以啦!后面会学到更多布局内容,要活学活用