這是我的第一篇文章,所以請原諒我的格式,如果它不正確。我正在構建一個項目,並且遇到了我的div問題。在我的項目中,我無法讓我的div顯示出他們的CSS風格。空格在那裏,他們應該是,但div(卡)應該是黃色的黑色邊框。爲什麼我的div標籤不顯示?
<!DOCTYPE html>
<html>
<head>
<title>Memory Card Game</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<h1>Memory Game</h1>
<nav a="#"><h2>Instructions</h2></nav>
<nav a="Game">Game</nav>
<p>Concentration, also known as Match Match, Memory, Pelmanism, Shinkei-suijaku, Pexeso, or Pairs, is a card game in which all of the cards are laid facedown on a surface and two cards are flipped face up over each turn. The object of the game is to turn over pairs of matching cards.</p>
<div class="board">
<div class="card"></div>
<div class="card"></div>
<div class="card"></div>
<div class="card"></div>
</div>
<footer>Created with ♥ by <span class="name">GA</span></footer>
<script type="text/javascript" src="main.js"></script>
</body>
</html>
h1 {
color: rgb(2, 132, 130);
}
h2 {
color: #ffd700;
}
body {
text-align: center;
}
.board {
display: inline-block;
height: 80%;
width: 50%;
background-color: yellow;
}
.card {
height: 200px;
width: 150px;
border-color: black;
border-width: 10px;
border-radius: 10px;
}
.name {
color: #ff0000;
}
的我的變化做了更新: http://imgur.com/a/GEXot
下面是什麼我的網頁在做什麼,它應該是什麼樣子的屏幕截圖。
https://imgur.com/a/1lyl4#bel6qqd
怎麼可能告訴從圖像?在你的問題中發佈[mcve]。 – j08691
將'color:black'更改爲'background-color:black'。但是你不想使用黃色?圖像中的卡片是黃色的。 –
感謝您的幫助,我的更新背景爲黃色,但卡片仍未顯示。 – Christopher