В статье обсуждается проблема использования внешних отступов (outer margin) в веб-дизайне. Автор объясняет, почему лучше избегать их в пользу внутренних отступов (padding) для компонентов. Основной аргумент: внутренние отступы делают дизайн более предсказуемым и гибким, упрощая настройку элементов и их позиционирование. Статья также содержит примеры и рекомендации для практического применения в современной веб-разработке.
Что такое «внешние» отступы и padding?
Здесь термин «внешние» относится к отступам, которые выходят за границы border-box пользовательского интерфейса. В основном это касается случаев, когда margin применяется к самому внешнему элементу компонента.
function Card({ children }) { return ( // WARNING: Don't do this! It is an outer `margin`! <div style={{ marginBottom: '1rem' }}>{children}</div> ) }
function EmployeeCard({ name, occupation }) { return ( <Card> {/** * This is fine! We can use internal margins for layout, * but there are better ways we'll learn later! */} <div style={{ marginBottom: '1rem' }}>{name}</div> <div>{occupation}</div> </Card> ) }
В статье обсуждается проблема использования внешних отступов (outer margin) в веб-дизайне. Автор объясняет, почему лучше избегать их в пользу внутренних отступов (padding) для компонентов. Основной аргумент: внутренние отступы делают дизайн более предсказуемым и гибким, упрощая настройку элементов и их позиционирование. Статья также содержит примеры и рекомендации для практического применения в современной веб-разработке.
Что такое «внешние» отступы и padding?
Здесь термин «внешние» относится к отступам, которые выходят за границы border-box пользовательского интерфейса. В основном это касается случаев, когда margin применяется к самому внешнему элементу компонента.
function Card({ children }) { return ( // WARNING: Don't do this! It is an outer `margin`! <div style={{ marginBottom: '1rem' }}>{children}</div> ) }
function EmployeeCard({ name, occupation }) { return ( <Card> {/** * This is fine! We can use internal margins for layout, * but there are better ways we'll learn later! */} <div style={{ marginBottom: '1rem' }}>{name}</div> <div>{occupation}</div> </Card> ) }
There are multiple ways you can search for Telegram channels. One of the methods is really logical and you should all know it by now. We’re talking about using Telegram’s native search option. Make sure to download Telegram from the official website or update it to the latest version, using this link. Once you’ve installed Telegram, you can simply open the app and use the search bar. Tap on the magnifier icon and search for a channel that might interest you (e.g. Marvel comics). Even though this is the easiest method for searching Telegram channels, it isn’t the best one. This method is limited because it shows you only a couple of results per search.
At a time when the Indian stock market is peaking and has rallied immensely compared to global markets, there are companies that have not performed in the last 10 years. These are definitely a minor portion of the market considering there are hundreds of stocks that have turned multibagger since 2020. What went wrong with these stocks? Reasons vary from corporate governance, sectoral weakness, company specific and so on. But the more important question is, are these stocks worth buying?