visit
With every upgrade, CSS's new features help you make beautiful layouts and design changes. It has the potential to drive aesthetics and action without even using JavaScript. You can do more than enough with HTML and CSS knowledge.
.scroll-container,
.scroll-area {
max-width: 850px;
height: 300px;
font-size: 60px;
}
.scroll-container {
overflow: auto;
scroll-snap-type: y mandatory;
height: 500px;
}
.scroll-area {
scroll-snap-align: start;
}
.scroll-container,
.scroll-area {
margin: 0 auto;
}
.scroll-area {
display: flex;
align-items: center;
justify-content: center;
color: white;
}
.scroll-area:nth-of-type(1) { background: IndianRed; }
.scroll-area:nth-of-type(2) { background: Moccasin; }
.scroll-area:nth-of-type(3) { background: thistle; }
.scroll-area:nth-of-type(4) { background: seagreen; }
</style>
<div class="scroll-container">
<div class="scroll-area">1</div>
<div class="scroll-area">2</div>
<div class="scroll-area">3</div>
<div class="scroll-area">4</div>
</div>
You can also define the behavior of the nested-scroll containers. You need to type the overall-behavior property over there. It doesn't care about anything and will take you to child movement. It's all because you have defined the scroll movement type as y mandatory
and alignment to start.
YOu can customize the things as per your proximity preference.
All the developers have three color accessibilities- RGB, HEX, and name. All three are good enough to give a webpage an appealing look. Everyone is trying to figure out impressive and innovative stuff. Seeing that, three more color palettes have been launched for web designers. It's the need of today; people are exploring new color schemes and do not hesitate to try the latest release.
Color Palette |
1st letter Property |
2nd letter Property |
3rd letter Property |
---|---|---|---|
HWB | Hue | Whiteness | Blackness |
LAB | CIE Lightness | The distance along the A axis | Distance l |
LCH | Lightness | Chroma | Hue |
Use it as follows:
input[type="radio"] {
accent-color: magenta;
}
@layer will enable access to the entry file for pre-define layers and order and saves you from time baggage. All the defined and loaded styles will preserve within a layer managing the override. It drives more freedom and control over the defined layers. You can see the visualization in Chrome DevTools.
One of the rich inclusion in the HTML world is <selectmenu>
. You just need to shift some functionalities as follows:
.my-select-menu::part(button) {
color: white;
background-color: red;
padding: 5px;
border-radius: 5px;
}
.my-select-menu::part(listbox) {
padding: 10px;
margin-top: 5px;
border: 1px solid red;
border-radius: 5px;
}
CSS Grid layout is a popular concept in CSS. It resembles the perfect layout in a rectangular shape. You just need to declare the display property as a grid. We can access similar CSS grid layout functionality through Flexbox.
You just need to mention the target grid and combine it with regular CSS grid layout properties. Try this with CSS grid columns and rows: grid-template-columns or grid-template-rows. The accessibility is not launched for Google Chrome, Safari, or Edge. We can expect the thisCSS-grid layout to launch at the end of the year or in 2023.
grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(2, auto);
}
.grid > figure {
display: grid;
grid-template-rows: subgrid;
}
.grid figcaption {
grid-row: 2;
}
Try to render the masonry layout to your project but don’t want to do anything extra. That’s fine. No need to include or call any JavaScript library; the CSS new features: Masonry layout is accessible here. You can have an organized masonry grid layout to display the images properly.
.container {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-template-rows: masonry;
}
You can access the live representation in Mozilla Firefox. It is one of the great evolution worth for web designers/ developers.
Many more CSS new features have been added to the new CSS version. Go and explore to avoid the complexity of development. No need to write heavy or complicated code or launch any library. Quickly check the CSS new features or learning resources, and implement them to get familiar with daily practice.