这是我的第一篇文章,所以请原谅我的格式,如果它不正确。我正在构建一个项目,并且遇到了我的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