build-your-own.org
BOOK
BLOG
SUBSCRIBE
build-your-own.org
prev ◄─┐
Contents
┌─► next
A Visual Guide To CSS
CHAPTER
Book info
Lines & boxes
Flow layout: inline vs. block
18
Pt2. Layout
Lines & boxes
img { display: inline; }
img { display: block; }
within a line
a whole new line
The fl
ow layout deals with
lines
:
●
inline
: element is placed within a line
●
block
: element gets its own line
inline box and block box
Whether an element is a box or not? (div-like or span-like?)
●
inline
: not a box; broken into lines (inline boxes)
●
block
: is a box; the whole box gets its own line
2 spans
4 inline boxes
2 divs
2 block boxes
inline-block?
display: inline-block;
Element gets a block box, and that box is inlined.
display: inline-table;
display: inline-grid;
NOTE
: div-like tags just have a browser CSS of
display: block;
(
Error report | Ask questions
)
@ build-your-own.org
A Visual Guide To CSS
prev ◄─┘
Contents
└─► next