Having a css /html issue please help? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

Having a css /html issue please help?

I am making a navigation bar with links inside of it, I want these links to be able to connect to sub links...example : If your on my page youll see the navigation bar, that bar has a list of options to click. One option will say bloggers, you click on bloggers a dropdown menu comes out and lists the bloggers. So than you click on my name (option in the dropdwon menu) and than 2 more options come out of the menu to either click on my blogs and be directed to the blog page or click on my profile and be redirected back to that page. I cant figure this out i have used so many options here is my code below : <li class="dropdown"> <a href="javascript:void(0)" class="dropbtn">Bloggers &#x21E9;</a> <div class="dropdown-content"> <a href="#">David Woods</a> <a href="#">Jeremy Dec</a> <a href="#">The Team</a> </div> </li>

12th Apr 2018, 4:33 PM
David CHAMPION
David CHAMPION - avatar
5 Answers
12th Apr 2018, 6:14 PM
Toni Isotalo
Toni Isotalo - avatar
+ 7
Toni Isotalo omg yes thank you so much
14th Apr 2018, 1:51 AM
David CHAMPION
David CHAMPION - avatar
+ 2
what is javascript:void(0) edit Hunted for answer https://stackoverflow.com/questions/1291942/what-does-javascriptvoid0-mean
12th Apr 2018, 4:49 PM
Manual
Manual - avatar
+ 1
Maybe bootstrap navbar can help you out. Just Google on it and explore its options
12th Apr 2018, 4:43 PM
***
*** - avatar
0
javascript: void(0); is used as a placeholder URL to indicate that an onclick event is tied to the link to do the actual action. The void operator evaluates the given expression and then returns undefined. If you have pass 0 as the unary expression operand to the void operator, JavaScript coerces 0 to "false" and returns, but void doesn't care and simply returns undefined, which means "do nothing" . Put them together, javascript: void(0); , and you have composed a way to programmatically "do nothing" when a link is clicked. <a href="#"> is a common alternative which might arguably be less bad. However you must remember to return false from your onclick event handler to prevent the link being followed and scrolling up to the top of the page. <a href="#" onclick="return false;">hello</a> http://net-informations.com/js/iq/void.htm
6th Jul 2021, 5:02 AM
malcomvx