Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

layer problem

Status
Not open for further replies.

QatQat

IS-IT--Management
Nov 16, 2001
1,031
IT
Hi there,

I have these two layers

<div id="main" style="position:absolute; left:0px; top:0; width:700; height:*; z-index:1;background-color: #C0D2B5;
layer-background-color: #C0D2B5; border: 1px none #000000;">




<div id="artlcle" style="position:absolute; left:490px; top:10; width:200; height:100; z-index:2;overflow: auto; background-color: #81A56B;
layer-background-color: #81A56B; border: 1px none #000000;">

''''some php stuff here

<!--end of article-->
</div>


<!--end of main-->
</div>

I am having problems with Main layer's height property, which I set to *.

If I type directly code in the main layer my height increases or decreases correctly.

I would like Main layer to stretch also when Article layer stretches. How do I achieve this?



Thank You

Qatqat







Life is what happens when you are making other plans.
 

You cannot do what you want while still having the main "layer" absolutely positioned. When you absolutely position something, it is effectively removed from the layout of the document, and given that both "layers" are absolutely positioned, it just won't happen for you.

That aside, I don't think that "layer-background-color" is a valid CSS property for a DIV element, and I don't believe that you can put "*" as a value for a height/width, either.

If you relatively position both "layers", then the "stretching" effect you are after should work, although you may have to play around with positioning a bit. If that isn't possible for you, I think the only want you can achieve it (while retaining absolute positioning) would be to use some scripting.

Hope this helps,
Dan
 
OK, thank for the answer.

How do I position it relatively?
is it something like

valign, align or different?


Thanks


Qatqat

Life is what happens when you are making other plans.
 
Instead of
Code:
<div id="artlcle" style="[b][s]position:absolute;[/s][/b] left:490px; top:10; width:200; height:100; z-index:2;overflow: auto; background-color: #81A56B;
layer-background-color: #81A56B; border: 1px none #000000;">
try
Code:
<div id="artlcle" style="[b]position: relative;[/b] left:490px; top:10; width:200; height:100; z-index:2;overflow: auto; background-color: #81A56B;
layer-background-color: #81A56B; border: 1px none #000000;">
You will need to adjust left and top values as well. Also note that all non-zero values must have units specified if you want different browsers to display the page identically. If no unit is specified, you leave it to browser's discretion. As Dan said it before, layer-background-color does not exist in css specs. I would suggest reading up on CSS to understand better what you are doing.
 
Actually I have been told that the layer-background instruction was needed by Mozilla.

Anyway, I will test it myself and see if it does really matter on Linux.

Coming back to the resizing of my Main layer, even setting both to relative, Main still does not stretch if article changes its size.

Any other idea?


Thanks

Life is what happens when you are making other plans.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top