This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > March 2004 > DIVs





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author DIVs
judas2

2004-03-31, 11:30 am

How can i center a fixed width css-p construction in my page using DIVs? Do I have to insert all the DIVs in a table and center the table? :-(
Barry Pearson

2004-03-31, 11:31 am

judas2 wrote:
> How can i center a fixed width css-p construction in my page using
> DIVs? Do I have to insert all the DIVs in a table and center the
> table? :-(


You can insert them in a fixed-width div and centre the div. (Are you aware of
the trick needed to centre a div in IE 5?)

But, see my other response (to Osgood). I think you could get a better result
than you did if you:

- Removed both the width & float from "centro", and let it flow into place
normally. (It would have to be placed *after* the sidebars in the HTML).

- Perhaps give it left & right margins of 33% to try to make it act like a
column even below the sidebars.

And, in case you want a flexible layout but with a *maximum* width, you could
use a single cell table to hold all the content. Give the cell (not the table)
a width (not a max-width), and see if you like the result.

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/


Osgood

2004-03-31, 11:31 am

judas2 wrote:

> How can i center a fixed width css-p construction in my page using DIVs? Do I have to insert all the DIVs in a table and center the table? :-(



<style type="text/css">
body {
text-align: center;
margin: 0 auto;
}

#myDiv {
width: 600px;
background-color: #ab1;
font: 12px arial;
color: #000;
}
</style>

<body>
<div id="myDiv">This is a centered</div>
</body>

Osgood

2004-03-31, 11:31 am

Osgood wrote:

> <style type="text/css">
> body {
> text-align: center;
> margin: 0 auto;
> }
>
> #myDiv {
> width: 600px;
> background-color: #ab1;
> font: 12px arial;
> color: #000;
> }
> </style>



The margin: 0 auto; should go in the #myDiv css style not the body style.

Murray *TMM*

2004-03-31, 11:31 am

(inline styles used for clarity)

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

Here is an example site -

http://www.roast-horse.com/tutorial...tent/index.html

You can see this method used on my sites -

http://www.compasspt.com
http://www.cordogbleu.com/test/

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
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
==================

"judas2" <webforumsuser@macromedia.com> wrote in message
news:c4ekkk$cba$1@forums.macromedia.com...
> How can i center a fixed width css-p construction in my page using DIVs?

Do I have to insert all the DIVs in a table and center the table? :-(


Osgood

2004-03-31, 11:31 am

Barry Pearson wrote:


> But, see my other response (to Osgood). I think you could get a better result
> than you did if you:


I didnt see your response Barry, which thread was it. I lose track of
this stuff easily.

Osgood

2004-03-31, 11:33 am

Barry Pearson wrote:

> Osgood wrote:
>
>
>
> Too busy talking to yourself - again! (But only a response this time, not a
> full dialogue).
>
> DIVs tutorials.
>

lol yeah I picked it up, thanks.

Barry Pearson

2004-03-31, 11:34 am

Osgood wrote:
> Barry Pearson wrote:
>
>
> I didnt see your response Barry, which thread was it. I lose track of
> this stuff easily.


Too busy talking to yourself - again! (But only a response this time, not a
full dialogue).

DIVs tutorials.

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/


Al Sparber- PVII

2004-03-31, 11:34 am

judas2 wrote:
> How can i center a fixed width css-p construction in my page using
> DIVs? Do I have to insert all the DIVs in a table and center the
> table? :-(


Study the markup and the CSS:
http://www.projectseven.com/csslab/.../withfooter.htm

--
Al Sparber - PVII
http://www.projectseven.com
Dreamweaver Extensions - DesignPacks - Tutorials - Books
---------------------------------------------------------------------
The PVII Newsgroup | news://forums.projectseven.com/pviiwebdev
The CSS Newsgroup | news://forums.projectseven.com/css
---------------------------------------------------------------------



judas2

2004-03-31, 11:38 am

margin: 0 auto; in the wrapper? easy when you know it!!!
Thanks a lot to everybody
Special thanks to Al Sparber
Murray *TMM*

2004-03-31, 1:33 pm

Yes - I agree with both! 8)

However, on reexamination, Al's illustration is failing.

collapse additonal content

I hear absolutely no additonal content collapsing (what is that, anyhow?).
;-)


--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
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
==================

"judas2" <webforumsuser@macromedia.com> wrote in message
news:c4ens6$hi7$1@forums.macromedia.com...
> margin: 0 auto; in the wrapper? easy when you know it!!!
> Thanks a lot to everybody
> Special thanks to Al Sparber



Al Sparber- PVII

2004-03-31, 1:34 pm

Murray *TMM* wrote:
> Yes - I agree with both! 8)
>
> However, on reexamination, Al's illustration is failing.
>
> collapse additonal content
>
> I hear absolutely no additonal content collapsing (what is that,
> anyhow?). ;-)


Turn your speakers up and look underneath your monitor.


--
Al Sparber - PVII
http://www.projectseven.com
Dreamweaver Extensions - DesignPacks - Tutorials - Books
---------------------------------------------------------------------
The PVII Newsgroup | news://forums.projectseven.com/pviiwebdev
The CSS Newsgroup | news://forums.projectseven.com/css
---------------------------------------------------------------------



Murray *TMM*

2004-03-31, 1:35 pm

I did that, but I only see dust bunnies.... 8)

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
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
==================

"Al Sparber- PVII" <adSTRApmin@projectseven.com> wrote in message
news:c4eq02$kng$1@forums.macromedia.com...
> Murray *TMM* wrote:
>
> Turn your speakers up and look underneath your monitor.
>
>
> --
> Al Sparber - PVII
> http://www.projectseven.com
> Dreamweaver Extensions - DesignPacks - Tutorials - Books
> ---------------------------------------------------------------------
> The PVII Newsgroup | news://forums.projectseven.com/pviiwebdev
> The CSS Newsgroup | news://forums.projectseven.com/css
> ---------------------------------------------------------------------
>
>
>



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews