Html5 filtering with adjacent list
Html5 filtering with adjacent list
I want a filter div with adjacent parameters like,
`List 1` `List 2`
| |
`item 1` `price`
My code suggestion is as follows
<ul>
<li><a>List 1</a>
<ul>
<li><a>item 1</a></li>
</ul>
</li>
<li><a>List 2</a>
<ul>
<li><a>price</a></li>
</ul>
</li>
</ul>
but it makes list under one another,
`List 1`
|
`item 1`
`List 2`
|
`price`
1 Answer
1
That's because you're using two <li>
s in the main list, for the different things you want. Use one for List 1
and List 2
, and one for Item 1
and Price
:
<li>
List 1
List 2
Item 1
Price
<ul>
<li><a>List 1</a>
<a>List 2</a></li>
<li><a>Item 1</a>
<a>Price</a></li>
</ul>
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.