Best way to style a default HTML 5 page? - css

What would be the best way to style a HTML 5 website (to also function in IE6)?
<header>
[ Header ]
</header>
<section>
<article>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent varius ultricies nibh faucibus tempor. Aliquam erat volutpat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Praesent hendrerit nunc vitae nisl accumsan dictum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Integer convallis lobortis turpis posuere semper. Proin ligula mi, hendrerit sit amet feugiat eu, dapibus sed ante. Donec lacinia aliquam felis at gravida. Praesent varius lectus enim. Nulla vehicula, odio id feugiat ornare, nibh urna elementum arcu, ut suscipit odio velit vel augue. Maecenas enim dolor, tincidunt a luctus ornare, viverra ut lorem. Suspendisse imperdiet est id mi pulvinar quis interdum felis vehicula.
</article>
<aside>
[ Aside ]
</aside>
</section>
<footer>
[ Footer ]
</footer>
CSS
header {
display:block;
clear:both;
background-color:red;
height:43px;
}
section article {
display:block;
float:left;
width:800px;
background-color:green;
}
section aside {
display:block;
width:180px;
background-color:lime;
}
footer {
display:block;
clear:both;
background-color:blue;
height:43px;
}
My real question, must I now add after the tag?

Everything you need to know is at http://html5boilerplate.com/

Remember to add
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
To your head to ensure that IE can style these elements.

Related

Bootstrap spans not working with full height sidebar

I'm trying to create a responsive layout in bootstrap that has a full-height sidebar. I got the responsive part working, but the only problem is - the spacing of the spans don't seem to be playing well together.
On the right side - the main content - it doesn't span to fit the rest of the screen. Also, when the browser gets too small - the main content actually gets partially hidden by the sidebar.
Am I doing something wrong with the spans? If I remove the position: absolute; from the .sidebar, then the whole .content. piece slides underneath the sidebar - but the sidebar is no longer full height, and the content still doesn't fill the rest of the screen evenly. It seems as it's impossible to get this working correctly, but I want to use bootstrap for the convenience of not having to redo all the CSS/JS that's integrated.
Example:
CSS
html {
height: 100%;
}
.sidebar {
background: #333;
margin: 0;
padding: 3em 2em;
height: 100%;
-moz-box-shadow: 0 0 5px #888;
-webkit-box-shadow: 0 0 5px#888;
box-shadow: 0 0 5px #888;
min-height: 100%;
position: absolute;
}
.sidebar .logo { margin-bottom: 3em; }
.content {
margin: 5em;
}
HTML
<body>
<div class="row">
<!-- Navigation for small screens -->
<div class="navbar navbar-inverse hidden-desktop">
<div class="navbar-inner">
<a class="brand" href="/">Home Link</a>
<ul class="nav">
<li>Projects</li>
<li>Photography</li>
<li>Contact</li>
</ul>
</div>
</div>
<!-- Navigation for larger screens -->
<div class="span3 hidden-phone hidden-tablet">
<div class="span3 sidebar">
<div class="logo"><a class="logo-title" href="/">Home Link</a></div>
<ul class="nav nav-pills nav-stacked">
<li>Projects</li>
<li>Photography</li>
<li>Contact</li>
</ul>
</div>
</div>
<div class="span9 content">
<div class="span5">
<div class="page-header">
<h1>Hello. <small>This is.</small></h1>
</div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris faucibus est vitae ante lobortis ultricies. Pellentesque blandit massa a velit convallis at accumsan elit gravida. Nulla facilisi. Fusce egestas consectetur velit vitae egestas. Cras vitae justo a sapien gravida condimentum. Donec lacinia lacinia ante. Proin eget est neque, ut egestas nibh. Donec non enim eu sem varius adipiscing. Proin dapibus enim a enim condimentum hendrerit. Donec vestibulum, mauris eget lobortis sagittis, enim libero dapibus augue, ac luctus ipsum augue quis purus. Aenean magna ante, elementum ac ultricies vitae, lobortis vitae augue. Nam metus erat, adipiscing posuere fringilla sit amet, molestie vel dolor. Quisque libero lacus, auctor eget porta vitae, vehicula eget mi. Vestibulum pulvinar hendrerit faucibus.
Aliquam scelerisque nisl sit amet mauris euismod bibendum. Phasellus ac laoreet enim. Praesent a felis id nisl ultrices dignissim. Nam dictum leo at quam vulputate mollis. Curabitur vitae ipsum enim, sit amet sollicitudin neque. Nunc iaculis ultricies convallis. Etiam nunc neque, consequat ac vehicula id, imperdiet in neque. Duis vitae sem magna. Nulla vehicula sapien sit amet sapien tempus tempus. Fusce pharetra dui nec risus sollicitudin vel pharetra arcu lacinia. Quisque eleifend sapien eu quam rutrum sed imperdiet nisi sagittis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque id placerat purus.</p>
</div>
<div class="span3">
<div class="page-header">
<h1>Second Header. <small>Not working.</small></h1>
</div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris faucibus est vitae ante lobortis ultricies. Pellentesque blandit massa a velit convallis at accumsan elit gravida. Nulla facilisi. Fusce egestas consectetur velit vitae egestas. Cras vitae justo a sapien gravida condimentum. Donec lacinia lacinia ante. Proin eget est neque, ut egestas nibh. Donec non enim eu sem varius adipiscing. Proin dapibus enim a enim condimentum hendrerit. Donec vestibulum, mauris eget lobortis sagittis, enim libero dapibus augue, ac luctus ipsum augue quis purus. Aenean magna ante, elementum ac ultricies vitae, lobortis vitae augue. Nam metus erat, adipiscing posuere fringilla sit amet, molestie vel dolor. Quisque libero lacus, auctor eget porta vitae, vehicula eget mi. Vestibulum pulvinar hendrerit faucibus.
Aliquam scelerisque nisl sit amet mauris euismod bibendum. Phasellus ac laoreet enim. Praesent a felis id nisl ultrices dignissim. Nam dictum leo at quam vulputate mollis. Curabitur vitae ipsum enim, sit amet sollicitudin neque. Nunc iaculis ultricies convallis. Etiam nunc neque, consequat ac vehicula id, imperdiet in neque. Duis vitae sem magna. Nulla vehicula sapien sit amet sapien tempus tempus. Fusce pharetra dui nec risus sollicitudin vel pharetra arcu lacinia. Quisque eleifend sapien eu quam rutrum sed imperdiet nisi sagittis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque id placerat purus.</p>
</div>
</div>
</div>
</body>
You're already setting that sidebar to absolute, why bother with the height: 100%? It'd be easier to simply add top:0; bottom:0.
The reason your sidebar is getting slid over the content like that is the absolute positioning of the sidebar. If you want to keep that from happening, I'd recommend setting a defined width in your sidebar class (say, of 240px), then changing content's CSS to read like so:
.content {
padding: 5em;
left: 240px;
right: 0;
top: 0;
bottom: 0;
overflow-y: auto;
}
That should constrain your content appropriately to not slide under your sidebar in any circumstance. Then, in order to make it appropriately responsive, adjust font size and width of your sidebar down as the screen reduces, and decrease the left property of .content to match the width of the sidebar.
Is that what you're looking for?

how to make div stick to bottom of overflow:auto parent div?

A slight twist on the common question of sticking a div to the bottom of a parent div. In this case I want the stuck div to STAY stuck even when it's parent is scrolled, and to be on top of the text that scrolls underneath. What's the trick? jsfiddle here: http://jsfiddle.net/forgetcolor/vYjMv/1/. code repeated below:
<!doctype html>
<html>
<head>
<style type="text/css">
#wrapper {
width:300px;
height:300px;
background-color:#eee;
position:relative;
overflow:auto;
}
.bot {
border:1px solid #ddd;
display:inline;
position:absolute;
bottom:0;
right:0;
color:blue;
}
</style>
<title>tst</title>
</head>
<body>
<div id="wrapper">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sed tempor nibh. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec molestie tortor non nisi accumsan placerat. Morbi elit risus, venenatis et sodales congue, tristique vel ligula. Maecenas convallis arcu turpis. Praesent nibh leo, blandit ut posuere et, aliquet at sapien. Ut placerat, libero id faucibus pellentesque, leo nulla consectetur ligula, quis malesuada sapien nulla id diam. Nullam turpis nisl, malesuada non gravida eu, eleifend et quam. Proin sit amet elit euismod odio tincidunt tempor. Sed eleifend tincidunt blandit. Cras eget sapien odio, a sodales dui. Pellentesque tincidunt varius sagittis. Nullam nisl est, volutpat sed fringilla at, faucibus id mi. Phasellus vel lacus nibh, eget consectetur nulla. Quisque vel elementum nibh. Etiam vitae lectus erat, eu euismod est.
</p>
<span class="bot">bottom</span>
</div>
</body>
</html>
you need to put another new div same width & height of warpper and stuck div to it:
check this:
<!doctype html>
<html>
<head>
<style type="text/css">
#fake_wrapper{
width:300px;
height:300px;
position:relative;
overflow:none;
}
#wrapper {
width:300px;
height:300px;
background-color:#eee;
overflow:auto;
}
.bot {
border:1px solid #ddd;
display:block;
position:absolute;
bottom:0px;
right:15px;
color:blue;
}
</style>
<title>tst</title>
</head>
<body>
<div id="fake_wrapper">
<div id="wrapper">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sed tempor nibh. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec molestie tortor non nisi accumsan placerat. Morbi elit risus, venenatis et sodales congue, tristique vel ligula. Maecenas convallis arcu turpis. Praesent nibh leo, blandit ut posuere et, aliquet at sapien. Ut placerat, libero id faucibus pellentesque, leo nulla consectetur ligula, quis malesuada sapien nulla id diam. Nullam turpis nisl, malesuada non gravida eu, eleifend et quam. Proin sit amet elit euismod odio tincidunt tempor. Sed eleifend tincidunt blandit. Cras eget sapien odio, a sodales dui. Pellentesque tincidunt varius sagittis. Nullam nisl est, volutpat sed fringilla at, faucibus id mi. Phasellus vel lacus nibh, eget consectetur nulla. Quisque vel elementum nibh. Etiam vitae lectus erat, eu euismod est.
</p>
</div>
<div class="bot">bottom fixed</div>
</div>
</body>
</html>
Check this one.
Made the position: fixed of .bot and added a top and left.

CSS: 3 row (header,footer,content) liquid layout, trying to make middle one expand on window.resize

I'm building a 3 row liquid layout. I have a fixed height header and a footer. I also have a minimum width for the wrapper (for these 3 rows).
The problem is, I can't make the middle one (#content) resize vertically. If I make position:absolute then I lose control over scrolling. I thought I could do it using the top,bottom,margin and padding while setting the height to 100% but I couldn't.
Here's the code that I'm using to test it and here's the fiddle link: http://jsfiddle.net/inhan/kUZgY/ You will see that the lighter gray background won't expand when window is resized.
I'm willing to use CSS only and not use HTML5 features. What am I missing? Thanks for any input.
CSS
body {
margin:0;
padding:0;
border:0;
height:100%;
max-height:100%;
}
* html body { /*IE6 hack*/
padding:30px 0;
}
* html #content { /*IE6 hack*/
height:100%;
width:100%;
}
#wrapper {
width:100%;
min-width:800px;
min-height:100%;
position:absolute;
}
#header, #footer {
position:absolute;
left:0;
width:100%;
height:30px;
overflow:hidden;
background-color:gray;
color:white;
}
#header {
top:0;
}
#footer {
bottom:0;
}
#content {
margin:31px 0;
overflow:hidden;
width:100%;
background:rgba(0,0,0,.2);
}​
HTML
<body>
<div id="wrapper">
<div id="header">This is header</div>
<div id="footer">This is footer</div>
<div id="content">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis. Nullam sit amet enim. Suspendisse id velit vitae ligula volutpat condimentum. Aliquam erat volutpat. Sed quis velit. Nulla facilisi. Nulla libero. Vivamus pharetra posuere sapien. Nam consectetuer. Sed aliquam, nunc eget euismod ullamcorper, lectus nunc ullamcorper orci, fermentum bibendum enim nibh eget ipsum. Donec porttitor ligula eu dolor. Maecenas vitae nulla consequat libero cursus venenatis. Nam magna enim, accumsan eu, blandit sed, blandit a, eros.<br/><br/>Quisque facilisis erat a dui. Nam malesuada ornare dolor. Cras gravida, diam sit amet rhoncus ornare, erat elit consectetuer erat, id egestas pede nibh eget odio. Proin tincidunt, velit vel porta elementum, magna diam molestie sapien, non aliquet massa pede eu diam. Aliquam iaculis. Fusce et ipsum et nulla tristique facilisis. Donec eget sem sit amet ligula viverra gravida. Etiam vehicula urna vel turpis. Suspendisse sagittis ante a urna. Morbi a est quis orci consequat rutrum. Nullam egestas feugiat felis. Integer adipiscing semper ligula. Nunc molestie, nisl sit amet cursus convallis, sapien lectus pretium metus, vitae pretium enim wisi id lectus. Donec vestibulum. Etiam vel nibh. Nulla facilisi. Mauris pharetra. Donec augue. Fusce ultrices, neque id dignissim ultrices, tellus mauris dictum elit, vel lacinia enim metus eu nunc.
</div>
</div>​
</body>
Extra Info
I'm actually not really interested in setting a minimum width for the whole page but some middle content will need that. So if I can, I might wanna make the whole structure respect when there's min-width property in the content that is loaded.
This should be what you're after http://jsfiddle.net/kUZgY/6/
You were just missing html {height:100%;}
I also changed the #header and #footer to position:fixed

Pure CSS solution for equal column height with stacked divs

I recreated my issue here.
The problem is that the 'left' div should be matching the combined height of 'top' and bottom' right divs. I have been reading articles and tutorials on how to achieve equal height with columns of varying content but none of them seem to apply to the 'stacked' columns.
My current nonworking solution was built on a concept taken from this article:
The only way to make the height of a div equal to the tallest column
is if that div contains all the columns. So to explain this another
way, by placing the columns inside a container we cause the container
to be the height of the tallest column. This is a very useful
structure. For this structure to work correctly in all browsers the
container div must be floated (left or right) plus each of the column
content divs must also be floated, it does not matter which way.
I am aware of the equalHeights jQuery plugin and resize, but I would very much prefer CSS solutions.
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<div id='container'>
<div id='height-container'>
<div id='left'>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque faucibus, nunc non semper fringilla, nibh mauris aliquam diam, sit amet suscipit purus ligula eu odio. Nulla tortor neque, sodales nec placerat vitae, laoreet a mi. In ac ullamcorper dui. Sed enim tellus, volutpat at tristique eu, condimentum volutpat tellus. Integer massa quam, egestas id vulputate id, ultrices ut felis.
</div>
<div id='right'>
<div id='top'>
Proin condimentum purus tortor, eu laoreet velit. Praesent ornare, mauris eu laoreet suscipit, nibh mauris imperdiet dolor, ut molestie erat tellus ac odio. Etiam tempor eros at neque tincidunt a feugiat massa imperdiet. Vestibulum aliquet nibh sit amet urna facilisis condimentum. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In ornare dolor quis neque aliquet lacinia et id tortor. Fusce eu sapien non mi aliquet condimentum id vitae ante. Phasellus sit amet eros vitae velit fringilla facilisis non at eros. In non venenatis lectus. Nam tortor tellus, vehicula non vulputate vitae, mollis a velit. Pellentesque gravida pretium ante, eu volutpat risus viverra non. Duis purus quam, venenatis nec consectetur interdum, aliquam rutrum diam. Donec interdum odio eget ante consectetur in sodales mi molestie. Nunc bibendum, turpis vel vulputate accumsan, diam tortor placerat sem, sed posuere risus purus eu massa. Nullam eleifend pulvinar massa, nec cursus velit dictum quis.
</div>
<div id='bottom'>
Praesent vel porttitor dolor. Nulla vel nisl quis nibh bibendum rutrum. In gravida lacus a tellus tempus at pretium quam iaculis. Quisque fringilla feugiat urna, ac tincidunt tellus ornare et. Aenean sit amet turpis at ante molestie accumsan. Duis vestibulum, tortor nec aliquam tincidunt, leo urna tincidunt nunc, et laoreet metus risus quis erat. Proin at sem leo, sit amet bibendum quam. Vivamus quam urna, pulvinar vel tempor eget, facilisis tristique ipsum. Aenean sed ipsum et odio convallis congue a sit amet leo. Morbi luctus odio a felis pellentesque sit amet cursus ante consectetur. <br><br>
Praesent vel porttitor dolor. Nulla vel nisl quis nibh bibendum rutrum. In gravida lacus a tellus tempus at pretium quam iaculis. Quisque fringilla feugiat urna, ac tincidunt tellus ornare et. Aenean sit amet turpis at ante molestie accumsan. Duis vestibulum, tortor nec aliquam tincidunt, leo urna tincidunt nunc, et laoreet metus risus quis erat. Proin at sem leo, sit amet bibendum quam. Vivamus quam urna, pulvinar vel tempor eget, facilisis tristique ipsum. Aenean sed ipsum et odio convallis congue a sit amet leo. Morbi luctus odio a felis pellentesque sit amet cursus ante consectetur.
</div>
</div>
</div>
</div>
</body>
</html>
CSS:
body{
text-align:justify;
}
#container{
width:1000px;
margin:0 auto;
}
#height-container{
background:orange;
float:left;
}
#left{
float:left;
width:200px;
background:#CD5555;
padding:20px;
}
#right{
width:600px;
float:right;
}
#top{
background:yellow;
padding:20px;
}
#bottom{
background:#00FF66;
padding:20px;
}
You can use display:table property for this:
#height-container{
background:orange;
display: table;
vertical-align:top;
}
#left{
display: table-cell;
width:200px;
background:#CD5555;
padding:20px;
}
#right{
width:600px;
display: table-cell;
}
Check this http://jsfiddle.net/6rBAw/2/
But it's work till IE8 & above
UPDATED
CSS
#left{
width:200px;
background:#CD5555;
}
#right{
float:right;
width:600px;
}
.clr{clear:both;}
HTML
<div id='right'></div>
<div id='left'>
<div class="clr"></div>
</div>
Check it http://jsfiddle.net/6rBAw/4/
Here is a solution which works in IE 7 as well http://jsfiddle.net/6rBAw/6/ this solution makes use of negative margin bottom and padding bottom, the only thing is you have to give the margin bottom and padding bottom value the same and a large value and give the container of the column overflow hidden property.
#container{
width:1000px;
margin:0 auto;
**overflow: hidden;**
}
#left{
float:left;
width:200px;
background:#CD5555;
**padding:20px 20px 99999px 20px;
margin-bottom: -99999px;**
}
#right{
width:600px;
float:right;
**padding-bottom: 99999px;
margin-bottom: -99999px;**
background-color: black;
height: 1000px;
}

Proper sizing of Google Map in a DIV in percentage

I am facing an interesting problem while working on Google Map Page. Actually I want the Map DIV will cover the 70% of Width leaving 30% for My Menus and 60% of Height leaving 40% for my website banner.
When I assigned the div height and width in % the map will not render properly instead it either shrinks to top or left depending on the % attribute assigned. But when I explicitly assign height and width in px say 400px the map will render perfectly.
I have also tried the minwidth and minheight style attributes.
It really depends on your current HTML and CSS but here's one way to do it.
The main layout uses the YUI Grids framework with some tweaks to correct the height of the map. As Gutzofter mentioned the crux of the fix is to assign appropriate heights to all of the map's ancestor elements. The following code was tested on IE6, IE7, IE8, Chrome 3 and Firefox 3.5
Hosted Demo: http://jsbin.com/okeja (Editable via http://jsbin.com/okeja/edit)
Full source:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Maps Demo</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<script src="http://www.google.com/jsapi?key=ABQIAAAAyxeu8JwbgrekKUEdhxe4EBTWx8njL9qYLnq46LoOVGM6mIGTuxQWuJ3Va3yaItAmIEsT4jgllHk5Ig" type="text/javascript"></script>
<link rel="stylesheet" href="http://yui.yahooapis.com/2.7.0/build/reset-fonts-grids/reset-fonts-grids.css" type="text/css">
<style type="text/css" media="screen">
html { height: 100%; background-color: #000; overflow: hidden; }
body { height: 100%; background-color: #000; font: 16px Helvetica, Arial; color: #fff; }
a:link, a:visited, a:hover { color: gray; }
#doc3 { height: 100%; padding:0; margin: 0; }
#bd { height: 100%;}
.container { height: 60%; }
.map { height: 100%; }
#map_canvas { height: 100%; }
.content { overflow-y: auto; height: 40%; }
</style>
</head>
<body>
<div id="doc3" class="yui-t7">
<div id="bd">
<div class="yui-gf container">
<div class="yui-u first">
<ul>
<li>foo</li>
<li>bar</li>
<li>baz</li>
<li>spam</li>
<li>eggs</li>
</ul>
</div>
<div class="yui-u map">
<div id="map_canvas"></div>
</div>
</div>
<div class="yui-g content">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus lacinia diam quis ipsum iaculis blandit. In mattis nibh ac velit congue a vehicula erat facilisis. Nam imperdiet nulla id tellus commodo et cursus urna aliquam. Donec vestibulum, eros ac rhoncus sodales, mi lacus elementum turpis, quis varius augue orci eget est. In vel vehicula erat. Aliquam eu orci lorem. Nullam a nisi adipiscing purus imperdiet convallis vitae varius elit. Mauris eu hendrerit eros. Sed at nunc sit amet sapien bibendum varius et eu augue. Nulla nisi est, bibendum id interdum vitae, fringilla eu mi. In et dolor est, quis rutrum enim. Vivamus quam nulla, euismod in elementum at, pulvinar nec est. Praesent tincidunt venenatis libero vitae interdum. Nam mattis molestie ligula, et laoreet risus eleifend eu.
Proin sodales lacus quis sem congue venenatis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Integer dictum enim a nibh pharetra venenatis. Cras lacinia nibh in eros malesuada id rhoncus erat mattis. Mauris urna ipsum, vulputate nec malesuada ut, volutpat vel magna. Duis blandit, dolor quis convallis faucibus, orci arcu vulputate nulla, a ullamcorper ligula risus eu mi. Quisque magna mauris, molestie id luctus id, aliquam vitae leo. Proin ut ligula et lacus iaculis sollicitudin. Fusce blandit consectetur nisi at cursus. Donec tincidunt sem et justo dapibus eu facilisis nunc laoreet. Quisque nibh urna, convallis ac ullamcorper in, dapibus et arcu. Nullam vel posuere nulla. Maecenas sed erat quam, placerat imperdiet metus.
Vivamus scelerisque, metus vitae venenatis pulvinar, ante libero auctor nisi, id malesuada orci tellus mattis nunc. Cras pretium sem nec est suscipit dictum. Etiam viverra fermentum augue, a gravida velit facilisis sed. Cras quis velit tortor, sit amet pellentesque leo. Mauris ligula nisi, tincidunt at faucibus a, aliquam vel elit. Etiam fringilla diam nisl, faucibus vestibulum justo. Aliquam erat volutpat. Sed diam diam, sodales eget mattis varius, vehicula at ipsum. Suspendisse semper blandit neque, vel bibendum dolor tincidunt at. Sed eleifend mollis metus vitae vehicula. Proin in augue vitae velit auctor vulputate. Sed auctor dictum blandit. Sed diam mi, aliquet vitae tempus sed, pharetra vel felis. Praesent tincidunt ipsum faucibus odio scelerisque quis lobortis odio facilisis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
</p>
</div>
</div>
</div>
<script>
function mapsLoaded() {
var map = new google.maps.Map2(document.getElementById("map_canvas"));
map.setMapType(G_SATELLITE_MAP);
map.enableContinuousZoom();
var geocoder = new GClientGeocoder();
geocoder.getLatLng('Dubai', function(latLng){
map.setCenter(latLng, 7);
for (var i = 0; i < 4; i++) {
after(3 * i, function(){map.zoomIn(null, null, true)});
}
});
}
function after(seconds, fn) {
setTimeout(fn, seconds * 1000);
}
function loadMaps() {
google.load("maps", "2", {"callback" : mapsLoaded});
google.load("jquery", "1.3");
}
loadMaps();
</script>
</body>
</html>
Try using a a map-wrapper div around the map-canvas and set the percentages on the map-wrapper. You might want to check out this book. The book goes into detail about auto resizing. Excerpts are on google books, to read look into chapter 6. It is mainly done with some JavaScript and CSS.

Resources