Basic question but I can't find it anywhere, is it possible to set the width and the height on the same line at the same time with the same value in my CSS?
I'm not asking for something like:
width:100%;height:100%;
But more like one of those:
width, height: 100%; // Same for both
width, height: 100%, 90%; // Different for each ones
dimensions: 100% 90%; // Like padding/margin,
I'm just asking about declaration, not Javascript on how to do that. I found a related question to this one but for border and the short answer was no.
If it's not possible with CSS, is it with SCSS ?
The height CSS property specifies the height of an element. By default, the property defines the height of the content area. If box-sizing is set to border-box , however, it instead determines the height of the border area.
Syntax: To set a div element height to 100% of the browser window, it can simply use the following property of CSS: height:100vh; Example: HTML.
CSS Border - Shorthand Property To shorten the code, it is also possible to specify all the individual border properties in one property. The border property is a shorthand property for the following individual border properties: border-width. border-style (required)
You can set up Sass Mixin, like this:
@mixin size($width, $height) {
width: $width;
height: $height;
}
Then write just:
@include size(100%, 100%);
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