DIV / SPAN

F

Frans

Another question I have is how to use wildcards in the
properties of DIV, SPAN like that. The relative position
of the elements???? left? top? height? width?????
I want to do that because the layout of my page's become's
more indepent from the resolution of the visitor's screen.

Thanks again,
Frans
 
M

MD Websunlimited

Hi Frans,

You can use a percentage but there is no wild card such as in frames.
 
M

Murray

Frans:

<span> should only be used as an inline element - that is, it should only
'contain' page content that can fit on a single line.

<div> is used to contain anything on a page, since it is a block-level tag.

By using position:absolute you are fixing the element in place on the
screen, i.e., immobile when the browser's viewport width/height is changed,
since position:absolute removes the element from the flow of the code, and
takes its position from the parent positioned element (usually the body
tag).

By using position:relative, you are NOT removing the element from the flow
of the code (in other words, it is positioned exactly were it would be if it
were not positioned) except that you can then move it relative to its parent
positioned container with the left, right, top and bottom offsets.

As you can see, this is not exactly a simple thing to swallow and will
require some study.

So - can I assume your question can be reworded as "how can I make a
positioned element move as the browser viewport dimensions change?"? If so,
then I'll tell you in a follow-on post.
 
G

Guest

Probably i can use percentage for left right height and
width and i think the elements will rearrange relative to
each other. Is that right? I can start with an DIV element
at the upper left corner with 0, 0, 100%, 100 or something
like that en position the others relative to this one.
Is that right?
Thank's again
Frans
 
M

Murray

No. The percentages will position the elements with regard to the PARENT
container's width/height.
 
M

Murray

Let me rephrase that. Percentages on an element placed with
position:absolute will position that element with regard to the 0,0
coordinates of its positioned parent. Percentages on an element placed with
position:relative will position that element with regard to where it would
have been placed in the flow of the code.
 
G

Guest

Taht's what i mean, thanks !!!
greetings,
Frans
-----Original Message-----
Let me rephrase that. Percentages on an element placed with
position:absolute will position that element with regard to the 0,0
coordinates of its positioned parent. Percentages on an element placed with
position:relative will position that element with regard to where it would
have been placed in the flow of the code.

--
Murray




.
 
Top