FRONTEND_1 Telegram 3977
🎯 Современный способ центрирования с place-items

Центрировать элемент — базовая задача, но многие до сих пор пишут лишнее:

Старый способ с Flexbox:


display: flex;
justify-content: center;
align-items: center;


Новый минималистичный способ с Grid:


display: grid;
place-items: center;


📌 place-items — это сокращение для align-items + justify-items. Работает только с CSS Grid, но зато:

* Меньше кода
* Более читаемо
* Идеально для одиночных элементов в контейнере

💡 Подходит для модалок, карточек, лоадеров и др.

⚙️ Поддержка: все современные браузеры (даже IE11 частично поддерживает place-items как -ms-grid)

Пробуй — и забудь про лишние строки!

👉 @frontend_1



tgoop.com/frontend_1/3977
Create:
Last Update:

🎯 Современный способ центрирования с place-items

Центрировать элемент — базовая задача, но многие до сих пор пишут лишнее:

Старый способ с Flexbox:


display: flex;
justify-content: center;
align-items: center;


Новый минималистичный способ с Grid:


display: grid;
place-items: center;


📌 place-items — это сокращение для align-items + justify-items. Работает только с CSS Grid, но зато:

* Меньше кода
* Более читаемо
* Идеально для одиночных элементов в контейнере

💡 Подходит для модалок, карточек, лоадеров и др.

⚙️ Поддержка: все современные браузеры (даже IE11 частично поддерживает place-items как -ms-grid)

Пробуй — и забудь про лишние строки!

👉 @frontend_1

BY Frontend разработчик




Share with your friend now:
tgoop.com/frontend_1/3977

View MORE
Open in Telegram


Telegram News

Date: |

The administrator of a telegram group, "Suck Channel," was sentenced to six years and six months in prison for seven counts of incitement yesterday. “[The defendant] could not shift his criminal liability,” Hui said. Choose quality over quantity. Remember that one high-quality post is better than five short publications of questionable value. Commenting about the court's concerns about the spread of false information related to the elections, Minister Fachin noted Brazil is "facing circumstances that could put Brazil's democracy at risk." During the meeting, the information technology secretary at the TSE, Julio Valente, put forward a list of requests the court believes will disinformation. fire bomb molotov November 18 Dylan Hollingsworth yau ma tei
from us


Telegram Frontend разработчик
FROM American