By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,879 Members | 1,859 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,879 IT Pros & Developers. It's quick & easy.

relative position of childs elements.

P: n/a
Hi,
I have a structer like this:

<div class="node">
<a><img /></a>
<div class="child">
<a><img /></a>
</div>
<div class="child">
<a><img /></a>
</div>
</div>

In the begining of my presentation i have display="none" for both
childs. Then using a javascript i make display="block". I want both
childs to be indented to the parent element( in my case the div elemnen
with class="node"). I wrote in my css file something like that.

..child{
position:absolute;
left:80px;
display:none;
}

When i make both visible they are indented to the parent but also they
are overlapped. And i do not want any overlap situation. Can anybody
help me?

Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
*Sergio del Amo Caballero* <se***@sbox.tugraz.at>:

<div class="node">
<a><img /></a>
<div class="child"><a><img /></a></div>
<div class="child"><a><img /></a></div>
</div>

In the begining of my presentation i have display="none" for both
childs. Then using a javascript i make display="block".
Is it really wanted that people without JS but with CSS don't have access to
the second and third link at all? Maybe you better keep their display as is
in the CSS and only fiddle with it in the JS part.
I want both childs to be indented to the parent element
margin-left: 80px;
.child{position:absolute; left:80px;}

When i make both visible they are indented to the parent but also they
are overlapped.


Of course they are, you gave them the exact same position.

--
"Try to learn something about everything and everything about something."
Thomas H. Huxley
Jul 20 '05 #2

P: n/a
Christoph Paeper wrote:
*Sergio del Amo Caballero* <se***@sbox.tugraz.at>:
<div class="node">
<a><img /></a>
<div class="child"><a><img /></a></div>
<div class="child"><a><img /></a></div>
</div>

In the begining of my presentation i have display="none" for both
childs. Then using a javascript i make display="block".

Is it really wanted that people without JS but with CSS don't have access to
the second and third link at all? Maybe you better keep their display as is
in the CSS and only fiddle with it in the JS part.


Sorry i did not understand what you mean. You told me that with css all
the child are going to be intended to the parent but overlapped. So the
atributte (position:absolute) is only useful when we have only one child
because if we have more we will have all of them overlapped. Is there
anyway to avoid this overlapping with css or i should try to solved it
with javascript?.
Thanks for your feedback

--
Sergio

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.