Css
Page Layout Technique example, want to let Div center, how to write CSS?
Div-Centered settings How do I write css? We are in the traditional table layout, as long as the table to set the center property to achieve the center of the block element. Application div CSS site layout, Div center How to write CSS to control it?
The main style definitions are as follows:
body {text-align:center;}
#center {margin-right:auto; margin-left:auto;}
First, the parent element defines text-align:center, which means that the content within the parent element is centered;
For IE this setting is already OK. But you can't center in Mozilla. The solution is to add margin-right:auto when the child element definition is set; Margin-left:auto;
Need special instructions, please note in the layout, if you want to use this method to make the whole page to center, we suggest not to set up in a Div, you can split out multiple div, as long as in each of the div defined margin-right:auto; Margin-left:auto, that's all.