block vs. inline
block
width: 100% by default
height: determined by content.
ๅฏ่จญๅฎ width, height
ๆ็ๆๆไฝๆๆด่ก(็ฑไธๅพไธๆ)
โข inline
ไธ่ฝ่จญๅฎ width, heightใ(width ็ฑ content ๆฑบๅฎ) โญ๏ธ
ๆ็ๆ็ฑๅทฆ่ณๅณใ
ไธ่ฝ่จญๅฎ margin-top, margin-bottomใโญ๏ธ
โข inline-block
ๆ็ๅ inline ๅ ็ด ็ฑๅทฆๅพๅณๆ๏ผ
ไฝๅฏ่จญๅฎ width, height ๅ block ๅ ็ด ใ
ๅ งๅปบ็ inline-block ๅ ็ด ๅ ฑไบๅ๏ผimg, button, select, input, textarea
block elements
<address><article><aside><blockquote><canvas><dd><div><dl><dt><fieldset><figcaption><figure><footer><form><h1>-<h6><header><hr><li><main><nav><noscript><ol><p><pre><section><table><tfoot><ul><video>
inline elements
inline elements can't change width and heigh.
<a><abbr><acronym><b><bdo><big><br><button><cite><code><dfn><em><i><img><input><kbd><label><map><object><output><q><samp><script><select><small><span><strong><sub><sup><textarea><time><tt><var>
Last updated