CSS em and rem explained

Опубликовано: 19 Апрель 2017
на канале: Kevin Powell
389,279
17k

A look at the CSS units EM and REM, how they work and when you might want to use one over the other!

First I take a look at some basic examples of both ems and rems, then move onto some more interesting things with buttons and a call to action, as well how we can take advantage of both the em and rem with media queries.

The way the em unit is calculated actually changes depending on if being used for that element's font-size or if it's being used for any other property, and this can be leveraged in some pretty awesome ways!

Knowing when to use em vs rem can be a tricky business, but hopefully this video can help put you on the right track!

Find the Codepen here: http://codepen.io/kevinpowell/pen/RKdjXe

--

New to Sass, or want to step up your game with it? I've got a course just for you: https://www.kevinpowell.co/learn-sass

--

I'm on some other places on the internet too!

If you'd like a behind the scenes and previews of what's coming up on my YouTube channel, make sure to follow me on Instagram and Twitter.

Instagram:   / kevinpowell.co  
Twitter:   / kevinjpowell  
Codepen: https://codepen.io/kevinpowell/
Github: https://github.com/kevin-powell/


На этой странице сайта вы можете посмотреть видео онлайн CSS em and rem explained длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Kevin Powell 19 Апрель 2017, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 389,279 раз и оно понравилось 17 тысяч зрителям. Приятного просмотра!