タグ

ブックマーク / wattenberger.com (1)

  • What does 100% mean in CSS?

    Spoiler: it dependsOne of the CSS units I use most is the wonderful % — so handy for positioning elements on the page. Unfortunately, the rules aren’t exactly straightforward. One question I’m always asking myself is: Percent of what?Hopefully this guide can help clear things up. Just give me the gist!#The basics: width & heightIn these examples, the purple box is our lovely self element — this is

    nc44v-134-nvtyqfgq
    nc44v-134-nvtyqfgq 2020/08/06
    cssの「%」の挙動について動かせる図を用いて解説してある。paddingやmarginの挙動は知らなかった。とくにmargin-topでも親のwidthを参照している点など
  • 1