css
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | css [2017/03/15 23:45] (current) – created shawn | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Center a block element ====== | ||
+ | '' | ||
+ | block element, we must make it smaller than the parent (otherwise, | ||
+ | what's the point?) then tell the browser to adjust the left and right | ||
+ | margins accordingly. | ||
+ | |||
+ | <code css> | ||
+ | div.center { | ||
+ | width: 80%; | ||
+ | margin-left: | ||
+ | margin-right: | ||
+ | /* -or- | ||
+ | margin: 0 auto; | ||
+ | */ | ||
+ | } | ||
+ | </ |
css.txt · Last modified: 2017/03/15 23:45 by shawn