dropshado.ws

padding-bottom border-box border bug (opens in new tab)

You can use padding-bottom as a way to set height of an element based on its parent width, so that it is proportional with its own width. /* item sized as a square 1/3 size of container */ .item { width: 33.3%; padding-bottom: 33.3%; } If you are using box-sizing: border-box and the element has border, you would expect that element to remain a perfect square. .item { width: 33.3%; padding-bottom: 33.3%; border: 2px solid; } But that’s not the case. Because the height is faked with padding-bot...

Read the original article
Sign in to keep reading the full article.

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help