code · How to Centre and Layout Pages Without a Wrapper
How to Centre and Layout Pages Without a Wrapper
The number one suggestion I see from the proprietor of html5gallery.com to submitters is not to use the “<section>” element as a glorified “<div id="wrapper">”. Here, I shall demonstrate that “<body>” is already a wrapper and can be hacked to achieve some pretty remarkable layout and clean code!
Let me just repeat that. The body element is already a wrapper. It can have a height, width, border, drop-shadow; you name it. Take for example, this markup:
<!DOCTYPE html>
<style>
body {width: 600px; margin: 20px auto; /* center */ padding: 20px;
border: 1px solid black;}
</style>
<body>
The Quick Brown Fox.
</body>
(Note that <html>, <head> and even <body> are optional in HTML!)
Mon 28 Apr 2014 05:29:16 PM CEST - permalink -
-
http://camendesign.com/code/developpeurs_sans_frontieres