Trouble with nested lists

742 views
Skip to first unread message

subs...@gmail.com

unread,
Feb 6, 2008, 6:00:44 AM2/6/08
to ha...@googlegroups.com
Hi,

I've just started using Haml and Sass and so far I've been finding
them really great.

However I am having trouble with trying to write out a simple nested
list like this:

<ul>
<li>Item</li>
<li>item
<ul>
<li>sub item</li>
<li>sub item</li>
</ul>
</li>
</ul>

In haml:

%ul
%li Item
%li Item
%ul
%li Item
%li Item

but it doesn't seem to work, am I doing something wrong?


Many thanks.

Nathan Weizenbaum

unread,
Feb 6, 2008, 6:14:03 AM2/6/08
to ha...@googlegroups.com
You're Giving two things as the content for the second <li>: "Item" and
the <ul>. If you want both to be nested beneath the <li>, you have to
indicate that explicitly:

%ul
%li Item
%li
Item
%ul
%li Item
%li Item


- Nathan

subs...@gmail.com

unread,
Feb 6, 2008, 6:24:24 AM2/6/08
to ha...@googlegroups.com
Thank you Nathan, that suddenly makes complete sense.

Cheers.

Reply all
Reply to author
Forward
0 new messages