ScotBlue Posted June 3, 2017 Share Posted June 3, 2017 I've been building my website for the first time using w3.css 4 - which I think is brilliant by the way. Makes things so much quicker. However, I've been wondering... when building a drop-down menu (like below) is there any requirement to include <ul> and <li> tags, even though the menu works and displays perfectly just using the w3 classes. I am guessing that it's most prob good practice to include the <ul> tags for search engine crawling purposes, but if anyone can shed any light on whether the these tags are actually required, I would appreciate it. Cheers. <!-- From https://www.w3schools.com/w3css/w3css_dropdowns.asp --> <div class="w3-dropdown-click"> <button onclick="myFunction()" class="w3-button w3-black">Click me</button> <div id="Demo" class="w3-dropdown-content w3-bar-block w3-card-4 w3-animate-zoom"> <a href="#" class="w3-bar-item w3-button">Link 1</a> <a href="#" class="w3-bar-item w3-button">Link 2</a> <a href="#" class="w3-bar-item w3-button">Link 3</a> </div> </div> Link to comment Share on other sites More sharing options...
dsonesuk Posted June 3, 2017 Share Posted June 3, 2017 For simple menu like yours no! The ul and li are not required, for menu that include sub or child menus, then a unordered listing (bullet list) would be preferable because of it nesting structure of UL and LI elements. 1 Link to comment Share on other sites More sharing options...
ScotBlue Posted June 3, 2017 Author Share Posted June 3, 2017 That's great. Thank you for clearing that up. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now