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

ident child

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>

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;
}

Both childs are indented but also overlapped!!. I can not belive that
there is no possibily of indent multiple children without overlapping.
Can anybody help me?

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


P: n/a
In article <3f***********************@aconews.univie.ac.at> ,
Sergio del Amo Caballero <se***@sbox.tugraz.at> wrote:
<div class="node">
<a><img /></a>
<div class="child">
<a><img /></a>
</div>
<div class="child">
<a><img /></a>
</div>
</div>

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;
}

Both childs are indented but also overlapped!!. I can not belive that
there is no possibily of indent multiple children without overlapping.
Can anybody help me?


..node { padding-left: 80px; }
or,
..child { margin-left: 80px; }

Oh, the blessings of margins and paddings. Without them we would still
be coding like it were 1998. One wonders why so many still do.

--
Kris
kr*******@xs4all.netherlands (nl)
Jul 20 '05 #2

P: n/a
Sergio del Amo Caballero wrote:
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>

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 {
margin-left: 2em;
}

Don't use positioning if you don't have to; you'll run into fewer
browser bugs that way.
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.