I fixed several tables in a div, and then prepared to place the div in the middle of the web page.
How should I set the position of the div?
If the width of this div is set Use padding-left to set the body with a percentage and center the div to the horizontal position of the page. Try
. Try using padding-top
is in the middle of the screen. Why
LZ search online about horizontal centering and vertical centering. There are many online.
align is to set the horizontal position of the content inside the div. If the width of the div is set, the horizontal position of the content is only in the middle of the div instead of the middle of the page.
valign The vertical position of the div seems not to be centered. Place the div in a Try setting the vertical centering of the td in a td with 100% height and width
margin:0 auto
position margin pading...
Do you mean you want to Centered? If so, just set the marginleft and marginright properties of the div to auto.
Agree with Floor 6, just give the DIV a width and let it adapt left and right.