When resizing browser window the content div overlaps the logo div is. is there any solution for this. I want the logo to resize when window is resized.
@charset "utf-8";
/* CSS Document */
html, body {
background-color:#ffffff;
margin:0;
padding:0;
height:100%;
width:100%;
}
#content {
height:74%;
background-color:#7d6961;
width:100%;
position:relative;
top: 10%;
}
#logo {
background-image:url(logo.png);
background-repeat:no-repeat;
position:absolute;
left: 9%;
top: 5%;
right: 2%;
bottom: 21%;
width: 77%;
height: 65%;
}
You have to use the resize-callback from the window-DOM Object.
Checkout this jsfiddle for an implementation example (I put the logo into an img-Tag, so it is always fully visible):
http://jsfiddle.net/qY3kM/
Dynamic resizing of images purely by css is not possible (afaik…maybe by using css-expressions, but they are ugly and should not be used at all.). There are also jquery plugins for dynamic resizing, but I never used one, so I cannot recommend one.