pcadv Posted January 25, 2007 Share Posted January 25, 2007 Hi,I have created a family website, centering the entire document on the web page. It is working fine and depending on the window size, it centers itself. However, while centering itself, it reduces its width and as a result all the alignment inside the document changes.I would like that the document centers itself but does not change its width. I have used HTML and css.In code in css file is:BODY { MARGIN-TOP: 0px; margin-bottom: 0px; border-width: 0px; padding: 0px; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #993300; background-repeat: no-repeat;}.cen{ margin-left: 12%; margin-right: 12%; height:100%; padding:0; border:0; }In the HTML file, all the document is placed inside the div class=cen<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><link rel="stylesheet" href="style11.css" type="text/css"></head><body><div class="cen"><H1><li><img src="image007.gif"></li><li><img src="image008.gif"></li></H1></div></body></html>It would be great if anyone canhelp me in this regard.thanks Link to comment Share on other sites More sharing options...
pulpfiction Posted January 25, 2007 Share Posted January 25, 2007 Did you try text-align: centerbody {text-align:center;..........}This will make the content in the <body> center. Link to comment Share on other sites More sharing options...
roondog Posted January 25, 2007 Share Posted January 25, 2007 Instead of margin-left: 12%;margin-right:12%; try margin: 0 auto; Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now