Jump to content

w3.css nav menus and ul & li tags


ScotBlue
 Share

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...