Lesson 4: Why "span" and not ".span" as a child element?


#1



https://www.codecademy.com/en/courses/learn-sass/lessons/hello-sass/exercises/nesting-sass


As a child element, I figured span would be ".span", but when I put the period there, the code didn't work right. How does the code know that "span" is supposed to refer to the span element in HTML? Is it because it is not a class?


.banner {
  font-family: 'Pacifico', cursive;
  height: 400px;
  background-image: url("lemonade.jpg");
  .slogan {
    position: absolute;
    border: 4px solid black;
    top: 200px;
    left: 25%;
    width: 50%;
    height: 200px;
    text-align: center;
    span {
      font-size: 24px;
      line-height: 200px;
    }
  }
}


#2

. indicates a class
# indicates an ID
elements, like span, p, h1, etc. have neither.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.