HTML新手,为什么我的标题栏不同

  • 本文关键字:标题栏 新手 HTML html css
  • 更新时间 :
  • 英文 :


不确定标题栏的问题出在哪里,我是HTML新手,我正在学习w3schools的教程,但当我创建标题栏时,黑色标题周围有一个白色边框,在他们给出的例子中没有,不确定为什么会发生这种情况。我已经从教程中复制了所有相关的部分。

HTML:

<!DOCTYPE html>
<html>
<head>
<title>Title</title>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>

<link rel="stylesheet" type="text/css" href="css/stylesheet.css"/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans"/>
</head>
<style>
html, body, h1, h2, h3, h4, h5 {font-family: "Open Sans", sans-serif}
</style>
<body>
<div class="header">
<a class="header-left" href="#">Home</a>
<div class="header-right">
<a href="#">Blog</a>
<a href="#">About</a>
<a href="#">Contact</a>
</div>
</div>
</body>
</html>

CSS:

.header {overflow:hidden;background-color:#000;padding:10px;}
.header a {color:#fff;text-align:center;text-decoration:none;font-size:20px;padding:10px;}
.header-left {float:left;}
.header-right {float:right;}

正在显示的页面,黑色标题周围有一个边框

请添加

html, body {margin:0; padding:0;}
.header {overflow:hidden;background-color:#000;padding:10px;brder:none;}
.header a {color:#fff;text-align:center;text-decoration:none;font-size:20px;padding:10px;}
.header-left {float:left;}
.header-right {float:right;}

在顶部的css中

最新更新