G
G
Gennady942021-04-14 16:23:21
css
Gennady94, 2021-04-14 16:23:21

Why doesn't the font size change?

Hello, I'm using SCSS to style the page. I have an h2 tag with an id title that has an initially defined size. I want to change the font size of the h2 tag with a maximum screen width of 320px, but this does not happen. I tried to change the font color, and everything works, but not with the size. Below code

form {
    display: flex;
    flex-direction: column;

    #title {
      font-size: $fontSize;
      font-weight: $fontWeight;
    }

    .button-div {
      display: flex;
      flex-direction: column;
      margin-top: 10px;

      button {
        position: relative;
        left: 50%;
        transform: translateX(-50%);
        width: $buttonWidth;
        height: $buttonHeight;
        margin-top: 20px;
        outline: none;
        border: none;
        border-radius: 5px;
        color: white;
        font-size: $buttonFontSize;
      }

      #facebook-btn {
        background-color: #064ebb;
      }

      #google-btn {
        background-color: #6d1ea6;
      }

      #facebook-btn:hover {
        background-color: #0644a1;
        cursor: $buttonCursor;
      }

      #google-btn:hover {
        background-color: #53177e;
        cursor: $buttonCursor;
      }
    }

    #email-link {
      text-decoration: none;
      margin-top: 30px;

      span {
        padding-left: 10px;
      }

    }
    #email-link:hover {
      text-decoration: underline;
    }
  }


/*iphone 5 breakpoint*/
$iphone-breakpoint: 320px;

/*media queries*/
@media (max-width: $iphone-breakpoint) {
    form {
      #title {
        color: green;
        font-size: 18px;
      }
    }
}


Changed: Font size initially 48px

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yuri, 2021-04-14
@Gennady94

Everything works if you remove the extra parenthesis before/*iphone 5 breakpoint*/

D
daniel_wesson, 2021-04-14
@daniel_wesson

It is bad practice to use identifiers for type elements, try changing to a class

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question