HighDots Forums  

centering a webpage in IE6

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss centering a webpage in IE6 in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
chrisallen76
 
Posts: n/a

Default centering a webpage in IE6 - 03-10-2005 , 10:07 AM






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


Reply With Quote
  #2  
Old   
Osgood
 
Posts: n/a

Default Re: centering a webpage in IE6 - 03-10-2005 , 10:09 AM






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:

Quote:
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



Reply With Quote
  #3  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: centering a webpage in IE6 - 03-10-2005 , 10:10 AM



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;}

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"chrisallen76" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
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




Reply With Quote
  #4  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: centering a webpage in IE6 - 03-10-2005 , 10:15 AM



Actually, that's only important if other positioned elements will be
contained within.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Osgood" <notavailable (AT) atthisaddress (DOT) com> wrote

Quote:
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





Reply With Quote
  #5  
Old   
Osgood
 
Posts: n/a

Default Re: centering a webpage in IE6 - 03-10-2005 , 10:26 AM



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:

Quote:
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;}



Reply With Quote
  #6  
Old   
chrisallen76
 
Posts: n/a

Default Re: centering a webpage in IE6 - 03-10-2005 , 10:44 AM



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


Reply With Quote
  #7  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: centering a webpage in IE6 - 03-10-2005 , 10:46 AM



Yes. And it will center in FF.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Osgood" <notavailable (AT) atthisaddress (DOT) com> wrote

Quote:
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;}





Reply With Quote
  #8  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: centering a webpage in IE6 - 03-10-2005 , 10:47 AM



You must be doing something wrong. Adding the text-align:center is all you
need to do.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"chrisallen76" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
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




Reply With Quote
  #9  
Old   
Osgood
 
Posts: n/a

Default Re: centering a webpage in IE6 - 03-10-2005 , 10:58 AM



Murray *TMM* wrote:

Quote:
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.



Reply With Quote
  #10  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: centering a webpage in IE6 - 03-10-2005 , 11:06 AM



You do not need the text-align:center for any browser than IE. It does not
HURT in other browsers, because you immediately reset it to text-align:left
in the wrapper. You do need it there to center in IE.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"Osgood" <notavailable (AT) atthisaddress (DOT) com> wrote

Quote:
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.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.