user1752541 user1752541 - 23 days ago 8
CSS Question

Two anchor tags beside each other in ul/li navigation

can somebody of you have a look at this example:

http://bootsnipp.com/snippets/featured/navigation-sidebar-with-toggle

I want to keep the toggle function, but the brand should be another link (homepage).

I tried like this:

<ul id="sidebar_menu" class="sidebar-nav">
<li class="sidebar-brand">
<a href="index.php">Menu</a><a id="menu-toggle" href="#">
<span id="main_icon" class="glyphicon glyphicon-align-justify"></span>
</a>
</li>
</ul>


But this will cause that there is a clickable brand, but the toggle button is not right from the brand. Instead it is in a new "navigation point".

Can somebody help me how I need to modify the given code to make this possible?

Thanks for any help! :)

Answer

This is your solution :

<li class="sidebar-brand">
   <a style="width:50%;" href="index.php">Home</a>
   <a id="menu-toggle" style="width:50%;height:95%" href="#"><span id="main_icon" class="glyphicon glyphicon-align-justify"></span></a>
</li>

You can also change "Home" to whatever you want.

also i should notice you have to put the styles in your style folder , but i added it inside tag for ease of describing.