Css id doesn't work

Hey! I have problem with my css styles not applying to the html id. I tried to search trough the forums and I really don’t know where the mistake is. Can you guys help me out maybe?
I was able to go around it with using “.” instead of “#” but I have come to the point where I need to use my class

Any help is appreciated.

This is my index:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="css/styles.css">

    <title>Responsive Web</title>
</head>
<body>
<!-- Hero section -->
<section id:"hero">
    <div class="hero container">
        <div>
            <h1>Hello,<span></span></h1>
            <h1>My Name Is<span></span></h1>
            <h1>Anna<span></span></h1>
            <a href="#" type="button" class="cta">Portfolio</a>
        </div>
    </div>
</section>
<!-- End of hero section -->
</body>
</html>

My css sheet:

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;700&display=swap');

*{
    padding: O;
    margin: 0;
    box-sizing: border-box;
}
html{
    font-size: 10px;
    font-family:'Montserrat', sans-serif;
}
a{
    text-decoration: none;
}
.container{
        min-height: 100vh;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

/* Hero section */
#hero{
   background-image: url("../img/backgim.jpg");
   background-size: cover;
   background-position: top center;
   position: relative;
   z-index: 1;
}
#hero::after{
    content: '';
    position: absolute;
    left: O;
    top: 0;
    height: 100%;
    width: 100%;
    background-color: black;
    opacity: .6;
    z-index: -1;
    /*-------This shit interesting-----*/
}
#hero .hero{
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 50px;
    justify-content: flex-start;
}
#hero h1{
    display: block;
    width: fit-content;
    font-size: 4rem;
    position: relative;
    color: transparent;
    animation: text_reveal .5s ease forwards;
    animation-delay: 1s;
}
#hero h1:nth-child(1){
    animation-delay: 1s;
}
#hero h1:nth-child(2){
    animation-delay: 2s;
}
#hero h1:nth-child(3){
    animation-delay: 3s;
}
#hero h1 span{
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background-color: crimson;
    animation: text_reveal_box 1s ease;
    animation-delay: .5s;
}
#hero h1:nth-child(1) span{
    animation-delay: .5s;
}
#hero h1:nth-child(2) span{
    animation-delay: 1.5s;
}
#hero h1:nth-child(3) span{
    animation-delay: 2.5s;
}
#hero .cta{
    display: inline-block;
    padding: 10px 30px;
    color: crimson;
    background-color: transparent;
    border: 2px solid crimson;
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: .1rem;
    margin-top: 30px;
    transition: .3s ease background-color;
    transition-property: background-color, color;
}
#hero .cta:hover {
    color: white;
    background-color: crimson;
}
/* End of hero section */

/* Keyframes */
@keyframes text_reveal_box{
    50%{
        width: 100%;
        left: 0;
    }
    100%{
        width: 0;
        left: 100%;
    }
}
@keyframes text_reveal{
    100%{
        color: white;
    }
}
/* End of Keyframes */

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

1 Like

that’s not how you give a value to a html attribute

I’m so blind xd Thank you so much