【HTML & CSS】學習筆記 #01


Posted by kane0927 on 2021-04-22

區塊元素特點 : display:block

  • 預設會佔據整個頁面的寬度
  • 可設定行高
  • 額外生成一行,無法並排

行內元素特點 : display:inline

  • 預設不會佔據整個頁面的寬度
  • 可以並排
  • 無法設定行高
  • ※ 除非下 display:block 轉換成區塊元素,才可設定寬高

box-sizing : content-box

margin - 外距
padding - 內距

  • 實際寬度 = content + padding + border

box-sizing : border-box

  • 實際寬度 = 你設定的寬高
  • 用就對了!!!電腦都幫你計算好了!!!



#html #css #box-sizing







Related Posts

彈出視窗 Modal

彈出視窗 Modal

2. DSP系統定義

2. DSP系統定義

Secure Apache Using Certbot with Let's Encrypt on Ubuntu 20.04

Secure Apache Using Certbot with Let's Encrypt on Ubuntu 20.04


Comments