Elastic Design is a cool way of designing the layout of our websites so that the layout doesn’t change according to the size of the browser and user’s font preference.
It uses ems for setting widths and a max-width style to ensure that the content is not too long. Since the size of an em is relative to the size of the font, the layout stretches when the font size is increased and it flexes to accomodate the browser width.
We can start by building a checklist of what an ideal layout would offer :
Advantages of Elastic Layouts:
Code
CSS:
body {min-width:640px} #header,#menu,#content,#sub-section,#footer { overflow:hidden; display:inline-block } /* safari and opera need this */ #header,#footer {width:100%} #menu,#content,#sub-section {float:left} #menu {width:20%} #content {width:60%} #sub-section {width:19.9%} #footer {clear:left}
HTML:
<div id="header"><h1>header</h1></div> <div id="menu"><h1>menu</h1></div> <div id="content"><h1>content</h1></div> <div id="sub-section"><h1>sub-section</h1></div> <div id="footer"><h1>footer</h1></div>