我是 html/css 的新手,做了一些教程并尝试添加一个简单的框。它显示文本,但不显示它周围的框。
这是我的CSS
body
{
background: #6a6a6a;
background-image: -moz-linear-gradient(top, #6a6a6a 0%, #353535 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6a6a6a), color-stop(100%,#353535));
background-image: -webkit-linear-gradient(top, #6a6a6a 0%,#353535 100%);
background-image: -o-linear-gradient(top, #6a6a6a 0%,#353535 100%);
background-image: -ms-linear-gradient(top, #6a6a6a 0%,#353535 100%);
background-image: linear-gradient(to bottom, #6a6a6a 0%,#353535 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6a6a6a', endColorstr='#353535',GradientType=0 );
background-size: auto;
background-position: center center;
background-repeat: no-repeat;
background-attachment: fixed;
.box
{
background: #fff;
border: 6px solid #ccc;
height: 100px;
margin: 20px;
padding: 20px;
width: 400px;
}
}
这是我的html
<!DOCTYPE html>
<html>
<head>
<title>Where do you want to go?</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link type="text/css" href="css/style.css" rel="stylesheet" />
</head>
<body>
<div class="box"> why doesn't this show up? </div>
</body>
</html>
“为什么这个不显示应该在一个盒子里,但它不是。