I need help understanding fallback?

Tell us what’s happening:
Describe your issue in detail here.

im confused on what to do? like fallback??

  **Your code so far**

<style>
:root {
  --red-color: red;
}
.red-box {

  background: var(--red-color);
  height: 200px;
  width:200px;
}
</style>
<div class="red-box"></div>
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36.

Challenge: Improve Compatibility with Browser Fallbacks

Link to the challenge:

Remember that CSS uses a “cascade” meaning that rules that are defined below another rule will take precedence. For example if I defined some rules like this:

p {
  font-size: 16px;
  font-size: 18px;
}

In the above example the font size of p tags will be 18px because that’s the line that is lower in the cascade. It overrides the font-size: 16px.

However if that last line were to not work for some reason (like if I were using a CSS feature that the browser didn’t support such as in the case of IE). then the line font-size: 16px would be the “fallback”.

1 Like

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