Learn
There are different data types you can assign to a variable in CSS.
In addition to the color data type we have seen, there are also:
Numbers, such as
8.11
,12
, and10px
. Notice that while10
has a unit ofpx
associated with it, it is still considered a number.Strings of text, with and without quotes. Some examples are
"potato"
,'tomato'
,span
.Booleans, or simply
true
andfalse
.null, which is considered an empty value.
Instructions
1.
In main.scss, make a variable of type number at the top of your file:
$icon-square-length: 300px;
Add the following inside the class selector .icon
:
width: $icon-square-length; height: $icon-square-length;
Click “Run” to see your changes in the browser and inspect output in main.css.
Sign up to start coding
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.