[pmwiki-users] nested divs
Waylan Limberg
waylan at gmail.com
Mon Feb 6 12:07:45 CST 2006
On 2/6/06, Hans <design at softflow.co.uk> wrote:
> Monday, February 6, 2006, 4:33:20 PM, Patrick wrote:
> > Part of the reason I chose >>div<< was because it would be a
> > convenient lever into nested divs, as in
>
> > >>div<<
>
> > >>>nested div<<<
>
> > >>>nested div<<<
>
> > >>outer div<<
>
> > >><<
>
> interesting, but if we ever get to nested divs i think they would need
> to work without such indicators as to what the nesting level is.
> I should be able to write for instance to create a floating right bar
>
> >>rfloat width=200px<<
> (:include RightBar:)
> >><<
>
> and be able to have divs in RightBar, without needing to know what
> level they might end up in.
This would be very cool.
>
> What annoys me about HTML <div> tags is the difficulty in seeing where
> exactly one div ends. Could the ending div markup not carry an indicator as
> to which opening div markup it belongs to? Like an id attribute? Then
> we won't need to specify levels.
>
I feel your pain. Generally, when I have a number of nested divs I
always try to keep my code neatly formatted and indented. Then, as an
extra help, I'll add a few comments like so:
<div id='div1'>
<div id='div2'>
...
</div> <!--END div1-->
</div> <!--END div2-->
Of course, this can get a little tricky if your HTML is generated by
PHP. But, a quick run of the output through HTMLTidy usually helps
when I can't see the problem.
--
----
Waylan Limberg
waylan at gmail.com
More information about the pmwiki-users
mailing list