[英]A part of styles didnt work when i add <!DOCTYPE html>
當我添加 !DOCTYPE html 時,y“Tweet”按鈕的樣式消失了。
<!DOCTYPE html>
<html>
<head>
<title>Buttons</title>
<link rel="stylesheet" href="styles/buttons.css">
</head>
<body>
<button class="buttonYT">SUBSCRIBE</button>
<button class="JOIN">JOIN</button>
<button class="Tweetb">Tweet</button>
</body>
</html>
來自 button.css 的推文按鈕的 css 部分
.tweetb {
background-color: rgb(29, 155, 240);
color: white;
border: none;
height: 36px;
width: 74px;
border-radius: 20px;
font-weight: bold;
font-size: 15px;
cursor: pointer;
margin-left: 8px;
transition: box-shadow 0.15s;
vertical-align: top;
}
.tweetb:hover {
box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.15);
}
從您的屏幕截圖中,推文按鈕的類名是TweetBT
,而在您的button.css
中是.tweetBT
,應該是.TweetBT
。
由於類名不匹配,因此不應用 CSS。 這不是 !DOCType Html 的問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.