多階層対応のドロップダウンメニューへ改造する サンプル01では1階層までのサブメニューを展開するメニューバーを作成しました。今度はより複雑な構造のサイトでも利用できるように、多階層対応のドロップダウンメニューへ改造します。 HTMLは次のようになります。サンプル01と同じようにul/li要素の入れ子で記述していきます。このサンプルでは、メニューA、Cは1階層目(子カテゴリー)までのサブメニューを、メニューBは2階層目(孫カテゴリー)までのサブメニューを記述しています。 ▼サンプル02(HTML部分) <ul class="menu"> <li><a href="#">メニューA</a> <ul class="sub"> <li><a href="#">サブメニューA</a></li> <li><a href="#">サブメニューA</a></li> <li><a href="#">サブメニ