Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

The style of y "Tweet" button disappears whem i adding !DOCTYPE html.

Tweet with style

Style gone

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Css part

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

css part of Tweet button from button.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);
}


>Solution :

  • From you screenshot class name for tweet button is TweetBT., whereas in you butttons.css it’s .tweetBT, which should be .TweetBT.
    As class name is not matching so CSS is not applied it’s not an issue with !DOCType Html. It’s because classname selector is not matching.
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading