我是新來的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>
了「爲什麼不這樣顯示出來應該是在一個盒子裏,但事實並非如此。
是CSS捲曲大括號錯位(沒有身後,兩個盒子)副本+粘貼到問題的錯誤? – WSkid