Click here to Skip to main content
15,896,118 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
#fotter
{
margin-top:10px;
margin-left:auto;
margin-right:auto;
text-align:center;
border:solid 1px black;
width:828px;
height:20px;
}


this is my div on Master page.it does not stay on the middle when i run the defult page. But it comes on the middle for other child pages

please help
Posted

Just in case, I tested your CSS sample — it works properly. The problem is not in the style or div, but somewhere else, in the code using it.

You can see what's going on using one simple thing: look at your code as at plain HTML+CSS. For this purpose, load the offending page on client side with the browser and use its "View Page Source". Alternatively, use "Save Page As". Check if CSS is referenced correctly, the attribute or id of the element is correct, etc.

—SA
 
Share this answer
 
XML
make a class of container as below in your css file

<pre lang="CSS">.container {
    width: 900px;
    margin: 0 auto;
}

</pre>

and proceed with the fallowing procedure in html

<pre lang="HTML"><div id="main">
<div class=container>

</div>

</div> </pre>
 in id=main you can handle with backgrouds ar other stuff.
class container div centers the contents of web side.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900