HighDots Forums  

<div align="center"> is not working

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss <div align="center"> is not working in the Macromedia Dreamweaver forum.



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

Default <div align="center"> is not working - 08-02-2004 , 08:24 PM






Hi Guys for some reason (base on my web page design) I need to use "
position:absolute " in this case
<div align="center"> is not working can any body help me

Thanks
Alireza

Here is my sample css code
.PageSet {
position:absolute;
width: 761px;
background-image: url(../images/teram.gif);
background-repeat: repeat-y;
}


Reply With Quote
  #2  
Old   
Donna Casey
 
Posts: n/a

Default Re: <div align="center"> is not working - 08-02-2004 , 10:39 PM






arjahan wrote:

Quote:
Hi Guys for some reason (base on my web page design) I need to use "
position:absolute " in this case
div align="center"> is not working can any body help me

Thanks
Alireza

Here is my sample css code
.PageSet {
position:absolute;
width: 761px;
background-image: url(../images/teram.gif);
background-repeat: repeat-y;
}

What are you centering? A wrapper or what? Why do you need absolute
positioning?

If this is a "wrapper" that holds the page content to center it, try

body {
text-align:center;
margin-left:auto;
margin-right:auto;

#pageset {
position:relative;
width:761px;
left:auto;
right:auto;
}

Other than that, how you approach centering using absolute positioning
depends a lot on what the element is and where it is located in terms of
containing boxes.


HTH

Donna Casey | Web Designer/Developer

Co-Author | Macromedia Studio MX Bible
Contributor | Dreamweaver MX Magic
Contributor | Fireworks MX Magic
------------------------------------------------------------
Team MM Fireworks Volunteer | www.macromedia.com/go/team


Reply With Quote
  #3  
Old   
arjahan
 
Posts: n/a

Default Re: <div align="center"> is not working - 08-03-2004 , 08:50 AM



Dear Donna

Thank you for your answer let me explain about my project , its a full CSS web
site that have too many <DIV> to control text blocks , pictures and ... I
start with PageSet class as a wrapper and then I have a lot of diffrent <DIV>
inside thisone the problem is if I use relative then netscape will not support
background and height control (because my nested classes) so I need to use
absolute and in this case align center will not work I use a javascript to set
my page marigin to center but the problem is in this case when the user try to
print the page its become a large page and will not fit in one page

Thank you Alireza


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

Default Re: <div align="center"> is not working - 08-03-2004 , 09:08 AM



You need to center align an absolutely positioned division?

It's not really clear what you are asking.

--
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
==================

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

Quote:
Hi Guys for some reason (base on my web page design) I need to use "
position:absolute " in this case
div align="center"> is not working can any body help me

Thanks
Alireza

Here is my sample css code
.PageSet {
position:absolute;
width: 761px;
background-image: url(../images/teram.gif);
background-repeat: repeat-y;
}




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

Default Re: <div align="center"> is not working - 08-03-2004 , 10:04 AM



Sorry

You need to center align an absolutely positioned division? YES
or better to say some way to put it in something then center it.

Thank you

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

Default Re: <div align="center"> is not working - 08-03-2004 , 10:12 AM



You cannot 'center align' an absolutely positioned element, since it is ...
err ... absolutely positioned.

However, you can center align other types of things easily.

Here is a good demonstration -

http://www.roast-horse.com/tutorials/_tutorials/css_centered_content/index.html

And here is some code -

(inline styles used for clarity)

STYLESHEET -
body { text-align:center; } /* for IE5/IE5.5 */
#wrapper { text-align:left; }

BODY -
<div id="wrapper" style="width:760px; top:0; margin:0 auto;
position:relative;">
<div id="layer1" style="width:200px; top: 25px; left:140px;
position:absolute;">blah</div>
<div id="layer2" style="width:180px; top: 136px; left:23px;
position:absolute;">blah</div>
</div>

Try that - an outer relatively positioned division with a width and auto
left and right margins. All interior AP divisions will be centered, yet
retain the
same relative positioning.

--
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
==================

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

Quote:
Sorry

You need to center align an absolutely positioned division? YES
or better to say some way to put it in something then center it.

Thank you



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.