Topics
Overview
Web design and development usually consists of long lines of code but some properties act as life-saving tools for many developers. Nowadays, many CSS properties are invented to reduce many lines of CSS properties in our project. In this blog, we will learn some new CSS properties which can help you to reduce the number of CSS code.
Min ()
Many elements are assigned CSS properties like width or min-width to set a normal value or minimum value. But, now we can combine both in only one property using min().
min() has two parameters: initial value & minimum value.
min(initial value, minimum value);
Previously we used to code like this:-
width : 75%;
min-width :600px;
Now using min() , same css is written as:
width: min(75%, 600px);
Max ()
Same as the above example, instead of width or max-width to set a normal value or maximum value, it can be combined in only one max().
max() has two parameters: initial value & maximum value.
max(initial value, maximum value);
Previously we used to code like this:-
width : 75%;
max-width :900px;
Now using max() , same css is written as:
width: max(75%, 900px);
Conclusion
I hope that this blog might be useful to write new CSS in your code. In the future, there will be more blogs on new CSS properties.