Warning: preg_grep(): Compilation failed: quantifier does not follow a repeatable item at offset 27 in /var/www/tg-me/post.php on line 75
Frontend | Вопросы собесов | Telegram Webview: easy_javascript_ru/1202 -
Telegram Group & Telegram Channel
🤔 Чем em отличается от rem?

🟠Как работает `em`?
em зависит от размера шрифта родителя (font-size).
.parent {
font-size: 20px;
}

.child {
font-size: 1.5em; /* 1.5 * 20px = 30px */
}


Но если .child вложен в .parent, то он наследует font-size, а его em вычисляется относительно родителя.
.parent {
font-size: 20px;
}

.child {
font-size: 1.5em; /* 30px */
}

.grandchild {
font-size: 2em; /* 2 * 30px = 60px */
}


🟠Как работает `rem`?
rem всегда зависит от font-size у <html>.
html {
font-size: 16px;
}

.container {
font-size: 2rem; /* 2 * 16px = 32px */
}


🟠Когда использовать `em`, а когда `rem`?
Используйте rem, если нужно, чтобы шрифты и размеры были предсказуемыми
Используйте em, если хотите, чтобы элементы зависели от родителя

Ставь 👍 и забирай 📚 Базу знаний
Please open Telegram to view this post
VIEW IN TELEGRAM
👍1611🔥3😁1



tg-me.com/easy_javascript_ru/1202
Create:
Last Update:

🤔 Чем em отличается от rem?

🟠Как работает `em`?
em зависит от размера шрифта родителя (font-size).

.parent {
font-size: 20px;
}

.child {
font-size: 1.5em; /* 1.5 * 20px = 30px */
}


Но если .child вложен в .parent, то он наследует font-size, а его em вычисляется относительно родителя.
.parent {
font-size: 20px;
}

.child {
font-size: 1.5em; /* 30px */
}

.grandchild {
font-size: 2em; /* 2 * 30px = 60px */
}


🟠Как работает `rem`?
rem всегда зависит от font-size у <html>.
html {
font-size: 16px;
}

.container {
font-size: 2rem; /* 2 * 16px = 32px */
}


🟠Когда использовать `em`, а когда `rem`?
Используйте rem, если нужно, чтобы шрифты и размеры были предсказуемыми
Используйте em, если хотите, чтобы элементы зависели от родителя

Ставь 👍 и забирай 📚 Базу знаний

BY Frontend | Вопросы собесов


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/easy_javascript_ru/1202

View MORE
Open in Telegram


Frontend | Вопросы собесов Telegram | DID YOU KNOW?

Date: |

Telegram Gives Up On Crypto Blockchain Project

Durov said on his Telegram channel today that the two and a half year blockchain and crypto project has been put to sleep. Ironically, after leaving Russia because the government wanted his encryption keys to his social media firm, Durov’s cryptocurrency idea lost steam because of a U.S. court. “The technology we created allowed for an open, free, decentralized exchange of value and ideas. TON had the potential to revolutionize how people store and transfer funds and information,” he wrote on his channel. “Unfortunately, a U.S. court stopped TON from happening.”

How Does Bitcoin Work?

Bitcoin is built on a distributed digital record called a blockchain. As the name implies, blockchain is a linked body of data, made up of units called blocks that contain information about each and every transaction, including date and time, total value, buyer and seller, and a unique identifying code for each exchange. Entries are strung together in chronological order, creating a digital chain of blocks. “Once a block is added to the blockchain, it becomes accessible to anyone who wishes to view it, acting as a public ledger of cryptocurrency transactions,” says Stacey Harris, consultant for Pelicoin, a network of cryptocurrency ATMs. Blockchain is decentralized, which means it’s not controlled by any one organization. “It’s like a Google Doc that anyone can work on,” says Buchi Okoro, CEO and co-founder of African cryptocurrency exchange Quidax. “Nobody owns it, but anyone who has a link can contribute to it. And as different people update it, your copy also gets updated.”

Frontend | Вопросы собесов from us


Telegram Frontend | Вопросы собесов
FROM USA