タグ

関連タグで絞り込む (2)

タグの絞り込みを解除

CSSとCSS3に関するtaky1973のブックマーク (2)

  • Lesser known CSS quirks & advanced tips

    • Vertical padding is relative to element’s width not heightSo padding-top: 50% does not add 50% of the original height of the element as padding, but 50% of the width of the parent element: Knowing this we can easily make responsive elements that keep their height/width ratio: .square { width: 100%; height: 0; padding-bottom: 100%; } • Margins overlap, but only sometimesSo space between the follo

    Lesser known CSS quirks & advanced tips
    taky1973
    taky1973 2018/07/22
    Tips色々.
  • Flexboxのjustify-contentで最後の行を左寄せにする方法

    Flexboxのjustify-contentで最後の行を左寄せにする方法 Flexboxのjustify-contentではflexアイテムの配置方法が指定できます。 justify-contentに「center」と指定すればflexアイテムを中央寄せに、「space-between」と指定すれば両サイドを端に配置し中のflexアイテムを均等に、「space-around」と指定すればすべてのflexアイテムを均等に配置します。 以下は、justify-contentにspace-betweenを指定したサンプルです。flex-wrapにはwrapを指定してflexコンテナより溢れたflexアイテムは改行されるようにしています。 See the Pen Flexboxのjustify-content by Kazuma Nishihata (@to-r) on CodePen. 一見、

    Flexboxのjustify-contentで最後の行を左寄せにする方法
    taky1973
    taky1973 2017/10/30
    なるほどー。レスポンシブで幅ごとにカラム数を変更する時は複雑になりそうだが頭に入れておこう
  • 1