jspodisus Posted February 23, 2010 Share Posted February 23, 2010 I want a div to be stretched fully to 100% width of a browser. I made the width to 100% but still there is some blank space is there. Here i have attached the link to image.. i want the image to be fully stretched. Let me know how to do this.. Link to comment https://forums.phpfreaks.com/topic/193138-how-to-stretch-a-div-to-full-width-of-browser/ Share on other sites More sharing options...
avario Posted February 24, 2010 Share Posted February 24, 2010 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. Link to comment https://forums.phpfreaks.com/topic/193138-how-to-stretch-a-div-to-full-width-of-browser/#findComment-1017130 Share on other sites More sharing options...
haku Posted February 24, 2010 Share Posted February 24, 2010 I'm guessing you are trying to set up a sticky footer: http://www.cssstickyfooter.com/ Link to comment https://forums.phpfreaks.com/topic/193138-how-to-stretch-a-div-to-full-width-of-browser/#findComment-1017146 Share on other sites More sharing options...
jspodisus Posted March 21, 2010 Author Share Posted March 21, 2010 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? Link to comment https://forums.phpfreaks.com/topic/193138-how-to-stretch-a-div-to-full-width-of-browser/#findComment-1029478 Share on other sites More sharing options...
haku Posted March 21, 2010 Share Posted March 21, 2010 I'm thinking it's something wrong with your code. Link to comment https://forums.phpfreaks.com/topic/193138-how-to-stretch-a-div-to-full-width-of-browser/#findComment-1029623 Share on other sites More sharing options...
JeroenVO Posted March 23, 2010 Share Posted March 23, 2010 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> Link to comment https://forums.phpfreaks.com/topic/193138-how-to-stretch-a-div-to-full-width-of-browser/#findComment-1030848 Share on other sites More sharing options...
arbitter Posted March 24, 2010 Share Posted March 24, 2010 on my site, the body is: body { margin:0 0 0 0; padding:0 0 0 0; } don't know if the padding is it that'll fix it. Link to comment https://forums.phpfreaks.com/topic/193138-how-to-stretch-a-div-to-full-width-of-browser/#findComment-1031071 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.