Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Blog preview card using html and css

HagarRagab 190

@HagarRagab

Desktop design screenshot for the Blog preview card coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

zanfa97 100

@zanfa97

Posted

Great job, you can use [Custom properties] (https://css-tricks.com/a-complete-guide-to-custom-properties/) to store colors in variables in order to reuse them without rewriting them every time.

Marked as helpful

0

@A-noob-in-Coding

Posted

@zanfa97 To add up, the syntax of using custom properties or variables in common languages in CSS is:

--YourVariableName : ItsValue

The variables are assigned in root scope of css that is:

:root
{
    all variables goes in here
}

For example, lets suppose you want to store a color which is provided as a hsl or rgb value, in a variable because it is a such a hassle to write the color codes for the color over and over again, then it could look like this:

--GrayColor : rgb(128,128,128);

Now you can use this gray color as:

color : var(--GrayColor);

Marked as helpful

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord