Home     |     Photoshop    |     Flash General    |     Flash Actionscript    |     Dreamweaver    |     Macromedia Fireworks


Cervo Technologies
The Right Source to Outsource

Macromedia Dreamweaver

AP DIVS vs DIV tags


is it wise to layout ones site using AP DIVS instead of DIV tags? or are they the same thing?

liveonnoevil wrote:
> is it wise to layout ones site using AP DIVS instead of DIV tags? or are they the same thing?

The two are entirely different.

AP <divs> (layers) are stationary on the page. You give them
co-ordinates and that's where they stay. That seems easy enough but the
downside is that they are usually not connected to any other element in
the web page (out of the flow) therefore they cannot be affected or
react to anything around them, which in a lot of senarios you will NOT want.

Take an instance where two AP <divs> are directly inserted one beneath
the other (as a lot of new developers tend to do) and both filled with
text. The text in the top AP <div> will overflow ontop of the text in
the one below should the text get bigger as a result of different
browsers rendering the text diferently or more in the case of an end
user zooming the text so it's legible to them. This is not what you
desire to happen to your page and you should always take this into
account when designing.

<divs> are just containers without any positioning (unless you give them
some) and as such work together as a team to take into account movement
within the page due to extra elements being added or the volume of text
getting larger in depth.

<divs> are much more complex to learn therefore tables would be a better
solution until you can find time to practice building using <divs>

Use AP <divs> for pop-up menus or showin and hidding elments of your
page. They do have their uses but you need to know when and how to use
them. This only comes through trial and error.

-----------------------------------------------Reply-----------------------------------------------

No.  And yes, in the sense that both are div tags - but one is absolutely
positioned and the other is not.

It's like saying that our two cars are the same although yours is red and
mine is blue.

Absolute positioning is a complex thing, as is all use of the "position"
style.

This may help you understand positioning a bit -

There are 4 different types of positioning:
Absolute
Relative
Fixed
Static

Here is a brief explanation of each kind of positioning (with regard to
placement of elements on the page only)....

Position:absolute (or A/P elements)
-----------------------
This does several things -
1. It 'removes' the element from the flow of the code on the page so that
it can no longer influence the size or position of any other page element
(except for those contained within it, of course).

2. The absolutely positioned element takes its position from the position of
its closest PARENT *positioned* element - in the absence of any explicitly
positioned parent, this will default to the <body> tag, which is always
positioned
at 0,0 in the browser viewport.

This means that it doesn't matter where in the HTML code the layer's code
appears (between <body> and </body>), its location on the screen will not
change (this assumes that you have not positioned the A/P element within
a table or another A/P element, of course).  Furthermore, the space in
which
this element would have appeared were it not positioned is not preserved
on the screen.  In other words, absolutely positioned elements don't take
up any space on the page. In fact, they FLOAT over the page.

Position:relative (or R/P elements)
----------------------
In contrast to absolute positioning, a relatively positioned page element is
*not* removed from the flow of the code on the page, so it will use the
spot
where it would have appeared based on its position in the code as its
zero point reference.  If you then supply top, right, bottom, or left
positions
to the style for this element, those values will be used as offsets from
its
zero point.

This means that it DOES matter where in the code the relatively positioned
element appears (, as it will be positioned in that location (factoring in
the offsets) on the screen (this is true for any placement in the code).
Furthermore, the space where this element would have appeared is
preserved in the display, and can therefore affect the placement of
succeeding elements.   This means that the taller a relatively
positioned element is, the more space it forces on the page.

Position:static
-------------------
As with relative position, static positions also "go with the flow".  An
element with a static position cannot have values for offsets (top, right,
left, bottom) or if it has them, they will be ignored.  Unless explicitly
positioned, all div elements default to static positioning.

Position:fixed
------------------
A page element with this style will not scroll as the page content scrolls.
Support for this in elements other than page backgrounds is quirky

There are several  other things you need to know:

1.  ANY page element can be positioned - paragraphs, tables, images, lists,
etc.
2.  The <div> tag is a BLOCK level tag.  This means that if it is not
positioned or explicitly styled otherwise, a) it will always begin on a new
line on the screen, and b) it will always force content to a new line below
it, and c) it will always take up the entire width of its container (i.e.,
width:100%).
3.  The placement of A/P elements *can* affect the BEHAVIOR of other
elements
on the page.  For example, a 'layer' placed over a hyperlink will mask that
hyperlink.

You can see a good example of the essential difference between absolute and
relative positioning here -

http://www.great-web-sights.com/g_layersdemo.asp

You can see a good demonstration of why using layers for a page layout tool
is dangerous here -

http://www.great-web-sights.com/g_layer-overlap.asp

--
Murray --- ICQ 71997575
Adobe Community Expert
(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
==================

"liveonnoevil" <webforumsu@macromedia.com> wrote in message

news:f46atf$qtt$1@forums.macromedia.com...

ok so are AP elements are like one cell tables that dont scale with the browser
window?

 i set my AP DIVS up similar to how a table looks (each AP DIV being a cell).  
the area that contains my text is a nested inside an AP DIV that is set to
scroll on overflow.  It appears correctly within the some of the commonly used
browsers, both PC (firefox, explorer) and MAC (safari, firefox, explorer) .  
The only problem being, users dont have the option of increasing/decreasing the
size of the text thats inside the nested AP DIV.

 "Osgood" - when using Tables can i set  a cell up to scrool on overflow?   or
would i have to draw a table inside of the cell where i want my info to appear?

-----------------------------------------------Reply-----------------------------------------------

> ok so are AP elements are like one cell tables that dont scale with the
> browser
> window?

You could perhaps think of them that way, but why resort to such an
artifice?

> i set my AP DIVS up similar to how a table looks (each AP DIV being a
> cell).

That's a really poor approach.  If a table works best, then by all means,
use it!

> The only problem being, users dont have the option of
> increasing/decreasing the
> size of the text thats inside the nested AP DIV.

Sure they do - all text on all pages can be resized in the browser.

> "Osgood" - when using Tables can i set  a cell up to scrool on overflow?
> or
> would i have to draw a table inside of the cell where i want my info to
> appear?

Just put a div (not AP) in the table cell.  Use CSS to set its overflow
style to scroll and give it a height.

--
Murray --- ICQ 71997575
Adobe Community Expert
(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
==================

"liveonnoevil" <webforumsu@macromedia.com> wrote in message

news:f46gvg$5da$1@forums.macromedia.com...

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc