This seems like such a stupid question but I can't find the answer anywhere.
Is there a way to set multiple CSS properties to one value
border-left, border-right: 1px solid #E2E2E2;
the way that you can do with selectors?
.wrapper, .maindiv { ... }
Good News! You can layer multiple transform values, and yes, you can do it in one CSS property as well.
The declaration block contains one or more declarations separated by semicolons. Each declaration includes a CSS property name and a value, separated by a colon. Multiple CSS declarations are separated with semicolons, and declaration blocks are surrounded by curly braces.
Declaring multiple properties in a single rule allows you to apply many style instructions—such as size, color, and alignment—to an element all at once. We'll also explore creating a variety of CSS rules that allow us to apply different styles to different pieces of content in a single HTML document.
Shorthand properties are CSS properties that let you set the values of multiple other CSS properties simultaneously. Using a shorthand property, you can write more concise (and often more readable) style sheets, saving time and energy.
Nope. But for your example, you can do this:
border: solid #E2E2E2; border-width: 0 1px;
The attributes where there can be separate values for top, right, bottom, and left (eg, border-*, margin, padding) can usually be combined in a single attribute.
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