Jump to content

How to stretch a DIV to full width of browser ?


jspodisus

Recommended Posts

I cant see the image link but it is probably just the page margins (by default I think it is 10px) which would stop the div stretching right across the page. If you are using Dreamweaver just go into Page Properties and set the margins to 0px. Or put this:

 

<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>

 

In your page head.

  • 4 weeks later...
  Quote

I cant see the image link but it is probably just the page margins (by default I think it is 10px) which would stop the div stretching right across the page. If you are using Dreamweaver just go into Page Properties and set the margins to 0px. Or put this:

 

<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>

 

In your page head.

 

i tried but problem is remain there.. any other solution?

His code should work, however you can do the same with  margin: 0px;

You have to place your footer at the whole bottom of your code. It could be that you placed it in another div or table and has invisible borders or other padding and or margin settings.

 

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Title</title>
</head>
<body>
<style type="text/css">
<!--
body {
   margin: 0px;
}
-->
</style>

//place this on a single line, just in front of your </body>
<img src="footer.gif" width="100%" height="200" />
</body>
</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.