![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
hello, i am trying to center my webpage using css, it's working in Firefox and Opera but not IE6. i have this in my html <body> <div class='wrapper' content for page goes here . . </div> </body> and here is my style sheet body { background-color: white; color: black; font: 0.8em Arial, Helvetica, sans-serif; } div.wrapper { width: 624px; margin-left: auto; margin-right: auto; border: 1px solid red;} <<this is just so i can see where the wrapper is>> i think i've done this before on another site and it worked then, but i cant figure out why this isnt working. please help me and stop my descent into insanity! Thanks |
#3
| |||
| |||
|
|
hello, i am trying to center my webpage using css, it's working in Firefox and Opera but not IE6. i have this in my html <body> <div class='wrapper' content for page goes here . . </div> </body> and here is my style sheet body { background-color: white; color: black; font: 0.8em Arial, Helvetica, sans-serif; } div.wrapper { width: 624px; margin-left: auto; margin-right: auto; border: 1px solid red;} <<this is just so i can see where the wrapper is>> i think i've done this before on another site and it worked then, but i cant figure out why this isnt working. please help me and stop my descent into insanity! Thanks |
#4
| |||
| |||
|
|
add position: relative; to the 'wrapper' <div> css style. div.wrapper { width: 624px; margin-left: auto; margin-right: auto; border: 1px solid red;} chrisallen76 wrote: hello, i am trying to center my webpage using css, it's working in Firefox and Opera but not IE6. i have this in my html <body> <div class='wrapper'> content for page goes here . . </div /body> and here is my style sheet body { background-color: white; color: black; font: 0.8em Arial, Helvetica, sans-serif; } div.wrapper { width: 624px; margin-left: auto; margin-right: auto; border: 1px solid red;} <<this is just so i can see where the wrapper is>> i think i've done this before on another site and it worked then, but i cant figure out why this isnt working. please help me and stop my descent into insanity! Thanks |
#5
| |||
| |||
|
|
body { background-color: white; color: black; font: 0.8em Arial, Helvetica, sans-serif; text-align:center; } div.wrapper { width: 624px; margin-left: auto; margin-right: auto; border: 1px solid red;} |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
humm.... isnt text-align: center; just to cater for PC IE5x. The wrapper div> should center without needing to add text-align:center; to the body tag? Murray *TMM* wrote: body { background-color: white; color: black; font: 0.8em Arial, Helvetica, sans-serif; text-align:center; } div.wrapper { width: 624px; margin-left: auto; margin-right: auto; border: 1px solid red;} |
#8
| |||
| |||
|
|
i've tried text-align: center; in the body but it doesnt have any effect! i've also tried adding the position relative, but again no effect. I cant understand this at all! i dont want to have to add : <body align='center'> in the HTML |
#9
| |||
| |||
|
|
Yes. And it will center in FF. Huh? |
#10
| |||
| |||
|
|
Murray *TMM* wrote: Yes. And it will center in FF. Huh? It should center in all modern browsers (apart from pc IE5x) without the need to add text-align center, I think. I have to test it. |
![]() |
| Thread Tools | |
| Display Modes | |
| |