I had a concept for a simple (in appearance) menu which expands and retracts submenus using only CSS.
This is what have conceptualized:
<ul>
<li><a href="#">home</a></li>
<li><a href="#">main one</a>
<ul>
<li><a href="#">sub one</a></li>
<li><a href="#">sub two</a></li>
<li><a href="#">sub three</a></li>
</ul>
</li>
<li><a href="#">main two</a>
<ul>
<li><a href="#">sub one</a></li>
<li><a href="#">sub two</a></li>
</ul>
</li>
<li><a href="#">main three</a></li>
</ul>
I have coded the basic framework above (ignore lack of classes, ids, pipe symbols etc.) using nested unordered lists, but I'm having trouble keeping everything inline. All lists are list-style-type: none
and all list items are floated left.
Also, I don't know how to prevent the word wrapping so that the whole list item is moved to a new line as a whole instead of being broken in two.
Additionally, what property could I use in conjunction with the transition property to make the nested lists slide out on mouse click?