HTML variables use

HTML variables use
0

#1

Just curious If variables are used often in web design or coding. I think I see a value in them But cant help wonder how widely used they are.


#2

Well, if you are using HTML semantically, which you should, when you grabbing data or creating values in variables for, say, Javascript, you should use .


#3

Thank you. I just have not seen it used very much in peoples work. While checking out project feedback.
So thank you again


#4

Do you mean CSS variables?

If so they are used all over the place. For colors, padding and margin, fonts, in calc() functions, media queries, animations, CSS Grid. The list goes on. If you check out a place like codrops you will see them used a lot.


#5

Thank you for the response. And yes CSS variables I figured they would be more widely used. I kust have not seen them being used in much of the projects on the project feedback part of the forum. However I never really have looked at projects that were more advanced then the first four which I have completed.
I am definitely going to check out the link for Codrops.
Thank you very much.
Gabe.


#6

Sure campers new or new-ish to web development might not use them as much but they are definitely used by the industry. Also, you don’t have to do anything fancy with them, just being able to name values is pretty handy. Like not having to remember some color hex code but just referring to it by a name, like var(--main-blue) instead of #2196F3