簡體   English   中英

當我添加時,部分樣式不起作用<!DOCTYPE html>

[英]A part of styles didnt work when i add <!DOCTYPE html>

當我添加 !DOCTYPE html 時,y“Tweet”按鈕的樣式消失了。

有風格的推文

風格消失了

CSS部分

<!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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM