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

CSS入門2 ボックスモデルを理解する

CSS入門2 ボックスモデルを理解する

Atsushi Tadokoro

May 14, 2014
Tweet

More Decks by Atsushi Tadokoro

Other Decks in Technology

Transcript

  1. ઌिͷ෮श ‣ ͱΓ͋͑ͣɺ͜Ε͚ͩ͸Ա͍͑ͨʂ ϓϩύςΟʔ ஋ ಺༰ DPMPS ৭ͷ஋ ϑΥϯτͷ৭ CBDLHSPVOEDPMPS

    ৭ͷ஋ എܠͷ৭ GPOUTJ[F ௕͞ͷ஋ ϑΥϯτͷେ͖͞ GPOUXFJHIU ʙ  OPSNBM CPME  ϑΥϯτͷଠ͞ MJOFIFJHIU ௕͞ͷ஋ ߦؒͷେ͖͞ UFYUBMJHO MFGU DFOUFS MJHIU KVTUJGZ ߦἧ͑
  2. ઌिͷ෮श ‣ ৭ͱ௕͞ͷ஋ ୯Ґ ஋ ৭ w ৭ͷ໊લ SFE CMVF

    ZFMMPX XIJUFFUD  w ਐ਺Ͱ3(#ͷ஋ ʙ⒎⒎⒎ ௕͞ w FNɿจࣈ෼ͷେ͖͕͞FN w ɿύʔηϯτࢦఆ w QUɿϙΠϯτ QUJO  w QYɿϐΫηϧ ը໘্ͷ࠷খ୯Ґ
  3. ϘοΫεϞσϧ ‣ ίϯςϯτ ‣ ཁૉͷ಺༰ͦͷ΋ͷ ‣ CPSEFS ‣ ཁૉΛऔΓғΉ࿮ઢ ‣

    QBEEJOH ‣ ίϯςϯτͱϘʔμʔ·Ͱͷ༨ന ‣ NBHJO ‣ ྡ઀͢ΔଞͷϘοΫεཁૉͱϘʔμʔ·Ͱͷ༨ന ! ‣ QBEEJOHɺNBSHJO༨നͷαΠζΛௐ੔ͯ͠ɺϨΠΞ΢τΛ ੔͍͑ͯ͘ ‣ CPSEFSͷઢͷଠ͞ɺઢͷछྨɺ৭ɺΛௐ੔ͯ͠࿮ઢΛσβ Πϯ͢Δ
  4. ϘοΫεϞσϧ ‣ NBSHJO QBEEJOH CPSEFS͸ɺ্ԼࠨӈΛݸผʹઃఆͰ͖Δ ϓϩύςΟ ద༻͞ΕΔ৔ॴ NBSHJOUPQ QBEEJOHUPQ CPSEFSUPQ

    ্ NBSHJOSJHIU QBEEJOHSJHIU CPSEFSSJHIU ӈ NBSHJOCPUUPN QBEEJOHCPUUPN CPSEFSCPUUPN Լ NBSHJOMFGU QBEEJOHMFGU CPSEFSMFGU ࠨ
  5. ϘοΫεϞσϧ ‣ ্ԼࠨӈΛҰׅͯ͠ઃఆ͢Δ͜ͱ΋Մೳ ‣ ༨നͷ஋͸ҰൠαΠζ FN QU QY ͳͲ Ͱࢦఆ͢Δ

    ‣ ෳ਺ͷ஋ΛεϖʔεͰ۠੾ͬͯ·ͱΊͯهड़Ͱ͖Δ ஋ͷهड़਺ ઃఆ͞ΕΔํ޲  ্ԼࠨӈΛ·ͱΊͯઃఆ  ্Լɺࠨӈͷॱʹઃఆ  ্ɺࠨӈɺԼͷॱʹઃఆ  ্ɺӈɺԼɺࠨͷॱͰઃఆɻ ্͔Β࣌ܭ·ΘΓ
  6. ϘοΫεϞσϧ ‣ CPSEFSͷϓϩύςΟʔ ‣ ෯ XJEUI ɺ৭ DPMPS ɺܗ TUZMF

    ΛઃఆͰ͖Δ ϓϩύςΟ ઃఆͰ͖Δ஋ CPSEFSXJEUI େ͖͞ͷ୯Ґ CPSEFSDPMPS ৭ͷ୯Ґ CPSEFSTUZMF OPOF EPUUFE EBTIFE TPMJE EPVCMF HSPPWF  SJEHF JOTFU PVUTFU Ұׅࢦఆ XJEUITUZMFDPMPSͷॱͰઃఆ͢Δ
  7. ΑΓৄࡉͳηϨΫλͷࢦఆ ‣ จ຺ηϨΫλ ‣ MJFN\DPMPS^ ‣ MJFN\DPMPS^ ‣ I Q\DPMPS^

    ! ‣ DMBTTͱJE ‣ QOPUF\DPMPSSFE^ ‣ QOPUF\DPMPSSFE^ ! ‣ ٙࣅΫϥεηϨΫλ ‣ BMJOL\DPMPSG^ ‣ BWJTJUFE\DPMPS^ ‣ BIPWFS\DPMPSG^
  8. ΑΓৄࡉͳηϨΫλͷࢦఆ ‣ ࢠଙཁૉʹద༻ ‣ ෳ਺ͷηϨΫλΛ൒֯εϖʔεͰ۠੾ͬͯྻڍ͢Δ ‣ ͋ΔಛఆͷཁૉλΠϓͷࢠଙཁૉͰ͋Δͱ͖ʹ͚ͩద༻͞ ΕΔ ! ‣

    ௚઀ͷࢠཁૉʹ͚ͩద༻ ‣ ෳ਺ͷηϨΫλΛͰ۠੾ͬͯྻڍ͢Δ ‣ ௚઀ͷࢠཁૉʹ͚ͩద༻͞ΕΔ ! ‣ ܑఋཁૉʹద༻ ‣ ෳ਺ͷηϨΫλΛ Ͱ۠੾ͬͯྻڍ͢Δ ‣ ಉ͡਌ཁૉΛ࣋ͭʮܑఋʯཁૉʹ͚ͩద༻͞ΕΔ
  9. DMBTTͱJE ‣ DMBTTଐੑ ‣ ཁૉ໊ͷޙΖʹΛ͚ͭͯɺͦͷޙͷΫϥε໊Λ͚ͭΔ ‣ Ϋϥεଐੑ͸)5.-ͷλάʹʮDMBTTIPHFʯͱ͍͏ଐ ੑͰࢦఆ͞ΕΔ ! ‣

    JEଐੑ ‣ ཁૉ໊ͷޙΖʹΛ͚ͭͯɺͦͷޙͷΫϥε໊Λ͚ͭΔ ‣ Ϋϥεଐੑ͸)5.-ͷλάʹʮJEIPHFʯͱ͍͏ଐੑͰ ࢦఆ͞ΕΔ ‣ ಉ͡JEଐੑ͸ͻͱͭͷ)5.-ϑΝΠϧͷதͰճͷΈ࢖༻ Մ
  10. ٙࣅΫϥεηϨΫλ ! ‣ ٙࣅΫϥεηϨΫλ ‣ ໊લ΍ଐੑʹ͸ؔ܎ͳ͘ɺঢ়گʹΑͬͯมԽ͢ΔηϨΫλ ‣ BཁૉͷϦϯΫઃఆ͕୅දత ‣ MJOLˠະ๚໰ͷ63*΁ͷϦϯΫ

    ‣ WJTJUFEˠ๚໰ࡁͷ63*΁ͷϦϯΫ ‣ BDUJDFˠબ୒தͷϦϯΫ ‣ IPWFSˠݱࡏϚ΢ε͕ͦͷ্ʹདྷ͍ͯΔཁૉ
  11. ग़ྗϝσΟΞʹԠͨ͡࢖͍Θ͚ ‣ ελΠϧγʔτΛදࣔ͢ΔϝσΟΞʹԠͯ͡ৼΓ෼͚Δ͜ͱ ͕Ͱ͖Δ ‣ MJOLཁૉͷNFEJBଐੑͰઃఆ͢Δ ‣ $44ͷ!NFEJBͱ͍͏ηϨΫλΛ༻͍ͯ΋ઃఆՄೳ $44Ҏ߱ 

    ! ‣ ϝσΟΞͷछྨ ‣ BMMɿશͯͷϝσΟΞʹద༻ σϑΥϧτ  ‣ BVSBMɿԻ੠ಡΈ্͛ʹద༻ ‣ IBOEIFMEɿ1%"ͳͲͷܞଳ୺຤ʹద༻ ‣ QSJOUɿҹ࡮ग़ྗʹద༻ ‣ TDSFFOɿҰൠతͳΧϥʔϞχλʹద༻ ‣ UWɿςϨϏͳͲʹద༻
  12. ϙδγϣχϯά ‣ ϘοΫεͷ෯ɾߴ͞΍ɺςΩετͷճΓࠐΈͳͲઃఆͰ͖Δ ‣ XJEUIɿϘοΫεͷίϯςϯτ෦෼ͷ෯ ‣ ҰൠαΠζɺBVUP ‣ IFJHIUɿϘοΫεͷίϯςϯτ෦෼ͷߴ͞ ‣

    ҰൠαΠζɺBVUP ‣ qPBUɿςΩετͷճΓࠐΈͷઃఆ ‣ MFGU SJHIU OPOF ‣ DMFBSɿςΩεճΓࠐΈͷղআ ‣ MFGU SJHIU OPOF CPUI ‣ QPTJUJPO ‣ UPQ CPUUPN MFGU SJHIU