TheCatapult Posted April 13, 2012 Share Posted April 13, 2012 Hi, I would like to center the whole body of my web site including the divs there but I don't want the background also does. Can it be done? Thanks so much! Catapult Link to comment Share on other sites More sharing options...
harinezumi Posted April 15, 2012 Share Posted April 15, 2012 center the body, make everything transparent-background, and give a background image to the html.Check this to center body: CSS layout: 100% height with header and footertry: <style type="text/css">/*** 100% height layout with header and footer* http://peterned.home.xs4all.nl/examples/csslayout1.html* ----------------------------------------------* converted to html5* Feel free to copy/use/change/improve*/html{margin:0;padding:0;height:100%; /* needed for container min-height */overflow-y:scroll; /* Force scrollbars 100% of the time */ background-image:url('yourbackgroundimage.jpg'); /* here's your background */} body {position:relative; /* needed for footer positioning*/margin:0 auto; /* center, not in IE5 */width:750px; /* or whatever */height:auto !important; /* real browsers */height:100%; /* IE6: treaded as min-height*/min-height:100%; /* real browsers */ background-color:transparent; /* you can also experiment with opacity with an [font=courier new,courier,monospace]rgba[/font] colour (color with alpha channel) */background-image:none;}</style> good luck Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.