์ธ๋ผ์ธ ์์
ํ์ํ ๋ถ๋ถ๋ง ๊ณต๊ฐ ์ฐจ์ง.
์ฐ์ ๋ฐฐ์น์ ๊ธฐ๋ณธ์ ์ผ๋ก ๊ฐ๋ก๋ก ๋๋ํ ๋ฐฐ์น๋จ.
์) <span>, <img> ๋ฑ
๋ธ๋ก ์์
๊ฐ๋ก๋ก ๋ชจ๋ ์ฐจ์ง.
์ฐ์ ๋ฐฐ์น์ ๊ธฐ๋ณธ์ ์ผ๋ก ์๋์ ๋ฐฐ์น๋จ.
margin, padding, width, height ์ค์ ๊ฐ๋ฅ.
์) <p>, <div> ๋ฑ
์์ฝ
์ธ๋ผ์ธ ์์๋ ์๊ธฐ๋ถ๋ถ ์กฐ๊ธ๋ง <------><--><----->์ด๋ฐ ๋๋
๋ธ๋ก ์์๋ ๊ฐ๋ก๋ก ๊ฝ์ฐจ๋ ์ง์ฌ๊ฐํ ๋๋์ด๋ผ ๋ณด๋ฉด ๋๋ค.
์ธ๋ผ์ธ ์์๋ ๊ธฐ๋ณธ์ ์ผ๋ก ํฌ๊ธฐ๋ฅผ ์ง์ ํ ์ ์๋๋ฐ, display: inline-block ์ ์ง์ ํด์ฃผ๋ฉด ํฌ๊ธฐ๋ฅผ ์ค์ ํ ์ ์๋ค.
๋ธ๋ก ์์ ์์ ์ธ๋ผ์ธ ์์๋ฅผ ์ฝ์ ํ์ฌ ์ธ๋ผ์ธ ์์๋ฅผ ๊ด๋ฆฌ ํ ์ ์๋ค.
์ฐธ๊ณ
Inline-level content - MDN Web Docs Glossary: Definitions of Web-related terms | MDN
In CSS, content that participates in inline layout is called inline-level content. Most text sequences, replaced elements, and generated content are inline-level by default.
developer.mozilla.org
Block-level content - MDN Web Docs Glossary: Definitions of Web-related terms | MDN
In CSS, content that participates in block layout is called block-level content.
developer.mozilla.org
Inline formatting context - CSS: Cascading Style Sheets | MDN
This article explains the inline formatting context.
developer.mozilla.org
Block formatting context - Developer guides | MDN
A block formatting context (BFC) is a part of a visual CSS rendering of a web page. It's the region in which the layout of block boxes occurs and in which floats interact with other elements.
developer.mozilla.org
display - CSS: Cascading Style Sheets | MDN
The display CSS property sets whether an element is treated as a block or inline box and the layout used for its children, such as flow layout, grid or flex.
developer.mozilla.org
'๐ป FE > ๐ HTML & CSS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ HTML / CSS ] ํฌ์ง์ ๋, position (0) | 2023.12.14 |
---|---|
[ HTML / CSS ] z-index, stacking context (0) | 2023.12.14 |
[ HTML / CSS ] ๊ณต์ฉํค์๋ inherit, initial, unset (0) | 2023.12.12 |
[ HTML / CSS ] background-size ์์ฑ (auto, contain, cover) (0) | 2023.12.09 |
[ JS ] reduce() (0) | 2022.11.08 |