I have a stylesheet and a lot of styles with the same border color (#CCCCCC
to be precise).
Is there a way to specify some kind of variable and reuse that, so instead of typing #CCCCCC
over and over, I can type:
border: 1px solid $bordercolor;
P.S. I'm using ASP.NET MVC.
There are three different ways to specify colors in CSS.
Simply add the appropriate CSS selector and define the color property with the value you want. For example, say you want to change the color of all paragraphs on your site to navy. Then you'd add p {color: #000080; } to the head section of your HTML file.
.classA, .classB, .classC { border-color: #CCC; } .classA { border-width: 1px; border-style: solid; } ...
But you can't use the short-hand syntax to define the border anymore.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With