Upgrade to Pro — share decks privately, control downloads, hide ads and more …

デザインを見ながらフロントエンドコーディングをするときの考え方 / design-coding

Kou
November 15, 2019

デザインを見ながらフロントエンドコーディングをするときの考え方 / design-coding

Kou

November 15, 2019
Tweet

More Decks by Kou

Other Decks in Design

Transcript

  1. iPad(λϒϨοτ)ج४ͷϒϨΠΫϙΠϯτྫ SPɹ …ɹ320px ʙ 767px Tabɹ…ɹ768px ʙ 1023px PCɹ …ɹ1024px

    ʙ ͜ͷϒϨΠΫϙΠϯτ͸iPadͷॎը໘͸Tabදࣔɺԣը໘͸ PCදࣔʹͳΔ͜ͱΛҙ͍ࣝͯ͠·͢ɻͦͯ͠TabΑΓখ͍͞ ͱSPදࣔʹͳΓ·͢ɻ
  2. iPad(λϒϨοτ)ج४ͷϒϨΠΫϙΠϯτྫ SPɹ …ɹ320px ʙ 767px Tabɹ…ɹ768px ʙ 1023px PCɹ …ɹ1024px

    ʙ ChromeͷDeveloper Toolʹ͓͍ͯ΋768px(Tablet)ɺ 1024px(Laptop)ͱ͍͏Α͏ʹΤϛϡϨʔτը໘ͷαΠζΛ༻ ҙ͍ͯ͠·͢ɻͦͷͨΊίʔσΟϯά֬ೝ΋͠΍͍͢Ͱ͢ʂ
  3. ᶃ-1 ཁૉͷԣͷதԝدͤ (ΠϯϥΠϯཁૉ) .text-area { width: 200px; } .text {

    width: 100%; text-align: center; } <div class="text-area"> <p class="text">ςετͰ͢<br>ͯ͢ͱͰ͢</p> </div> CSS HTML
  4. ᶃ-1 ཁૉͷԣͷதԝدͤ (ΠϯϥΠϯཁૉ) .text-area { width: 200px; } .text {

    width: 100%; text-align: center; } <div class="text-area"> <p class="text">ςετͰ͢<br>ͯ͢ͱͰ͢</p> </div> CSS HTML .text-area ͷྖҬ಺Ͱ .text ͕ԣʹηϯλϦϯά͞Ε·͢
  5. ᶃ-1 ཁૉͷԣͷதԝدͤ (ϒϩοΫཁૉ) .text-area-container { display: block; width: 600px; }

    .text-area { display: block; width: 200px; margin: 0 auto; } .text { width: 100%; text-align: center; } <div class="text-area-container"> <div class="text-area"> <p class="text">ςετͰ͢<br>ͯ͢ͱͰ͢</p> </div> </div> CSS HTML
  6. ᶃ-1 ཁૉͷԣͷதԝدͤ (ϒϩοΫཁૉ) .text-area-container { display: block; width: 600px; }

    .text-area { display: block; width: 200px; margin: 0 auto; } .text { width: 100%; text-align: center; } <div class="text-area-container"> <div class="text-area"> <p class="text">ςετͰ͢<br>ͯ͢ͱͰ͢</p> </div> </div> CSS HTML .text-area ͷྖҬ͕ .text-area-container ͷྖҬ಺ͰԣʹηϯλϦϯά͞Ε·͢
  7. ᶃ-2 ཁૉͷॎͷதԝدͤ (transformΛ࢖͏) .text-area-container { position: relative; display: block; width:

    600px; height: 320px; } .text-area { position: absolute; top: 50%; display: block; width: 200px; transform: translateY(-50%); } .text { width: 100%; text-align: center; } <div class="text-area-container"> <div class="text-area"> <p class="text">ςετͰ͢<br>ͯ͢ͱͰ͢</p> </div> </div> CSS HTML
  8. ᶃ-2 ཁૉͷॎͷதԝدͤ (transformΛ࢖͏) .text-area-container { position: relative; display: block; width:

    600px; height: 320px; } .text-area { position: absolute; top: 50%; display: block; width: 200px; transform: translateY(-50%); } .text { width: 100%; text-align: center; } <div class="text-area-container"> <div class="text-area"> <p class="text">ςετͰ͢<br>ͯ͢ͱͰ͢</p> </div> </div> CSS HTML .text-area ͕ .text-area-container ͷྖҬ಺ͰॎʹηϯλϦϯά͞Ε·͢
  9. .button { display: inline-block; width: 200px; padding: 16px 8px; background-color:

    #00b8b5; border-radius: 50px; text-align: center; color: #fff; font-weight: bold; text-decoration: none; } <a href="https://mocri.jp" class="button">mocriެࣜαΠτ</a> CSS HTML ᶃ-2 ཁૉͷॎͷதԝدͤ (ϘλϯͷςΩετ)
  10. .button { display: inline-block; width: 200px; padding: 16px 8px; background-color:

    #00b8b5; border-radius: 50px; text-align: center; color: #fff; font-weight: bold; text-decoration: none; } <a href="https://mocri.jp" class="button">mocriެࣜαΠτ</a> CSS HTML .button ྖҬ಺ͰςΩετ͕ॎʹηϯλϦϯά͞Ε͍ͯΔ͔ͷΑ͏ʹදࣔ͞Ε·͢ ᶃ-2 ཁૉͷॎͷதԝدͤ (ϘλϯͷςΩετ)