Home > front end >  How can I put href into my code in dropdown
How can I put href into my code in dropdown

Time:11-12

So, I got my Dopdown for Languages, I want to make a href if I press on "English", how can I do that?

                <div >
                    <div >
                      Sprache:
                      <ul>
                        <li><b>Deutsch</b> <i  aria-hidden="true"></i>
                          <div ></div>
                          <ul>
                            <li><i ><div id="germany"></div></i> <span  >Deutsch</span></li>
                            <li><i ><div id="germany"></div></i> <span>English</span></li> 
                            <li><i ><div id="germany"></div></i> <span>Česky</span></li>
                          </ul>
                        </li>
                      </ul>
                    </div>
                  </div>

Im pretty new, to HTML and don't know where to put my href

CodePudding user response:

You could put the a anchor in the whole li element, so it works by clicking on the text and also the flag:

<li><a href="your_link"><i ><div id="germany"></div></i> <span>English</span></a></li> 

also, remember to change your ids, they're all germany now

CodePudding user response:

You can add an anchor tag <a> on the elements:

<li><i ><div id="germany"></div></i><a href="the link u want to put">English</a></li> 
  • Related