|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
CSS centre problem
Hi i have a css div that i am trying to centre on my page. however no matter what i try it doesn't seem to centre. the CSS code is below:
Code:
#toppanel {
position: absolute; /*Panel will overlap content */
/*position: relative;*/ /*Panel will "push" the content down */
top: 0;
width: 1000px;
z-index: 999;
text-align: center;
}
I have tried adding the following which i have used else where before but it doesn't work. Code:
margin:0 auto; Any suggestions would be appreciated. Thanks Stan |
|
#2
|
|||
|
|||
|
in order to center a div, use:
margin-left: auto; margin-right: auto; and make sure you set the width to the actual width.
__________________
Sir, a desire of knowledge is the natural feeling of mankind; and every human being, whose mind is not debauched, will be willing to give all that he has to get knowledge. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > CSS centre problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|