How can I have all navigation buttons centered? - html

I tried many ways to center all navigation buttons, I'm using text-align: center but it doesn't help because one of my buttons is an image and has greater height and width. I also had to resize the image because it was way too big.
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
nav {
background-color: white;
height: auto;
width: inherit;
margin-bottom: 0.5em;
border-top: 0px;
border-bottom: 2px;
border-left: 0px;
border-right: 0px;
border-style: inset;
border-width: auto;
border-color: red;
}
nav ul {
list-style-type: none;
overflow: auto;
}
nav ul li {
float: left;
margin-right: 20px;
height: auto;
width: auto;
margin: 10px;
text-align: center;
}
nav ul li a {
text-decoration: none;
display: table;
width: 100%;
height: 100%;
}
<header>
<nav>
<ul>
<li>
<img src="http://via.placeholder.com/100x100" alt="mylogo" style="width: 100px;height: 100px">
</li>
<li><span>APPS</span></li>
<li><span>CONTACT</span></li>
</ul>
</nav>
</header>

You can apply display: inline-block; to the li elements (remove all float: left) and text-align: center to the ul, which centers the li s inside the ul:
If you want the two text li vertically centered to the image li, add vertical-align:middle; to the lis
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
nav {
background-color: white;
height: auto;
width: inherit;
margin-bottom: 0.5em;
border-top: 0px;
border-bottom: 2px;
border-left: 0px;
border-right: 0px;
border-style: inset;
border-width: auto;
border-color: red;
}
nav ul {
list-style-type: none;
text-align:center;
}
nav ul li {
display: inline-block;
margin-right: 20px;
margin: 10px;
text-align: center;
vertical-align:middle;
}
nav ul li a {
text-decoration: none;
}
<header>
<nav>
<ul>
<li>
<img src="http://placehold.it/80x80/fda" alt="mylogo" style="width: 100px;height: 100px">
</li>
<li><span>APPS</span></li>
<li><span>CONTACT</span></li>
</ul>
</nav>
</header>

I think this is a nice case for using a simple flex. Set the container (nav ul) to display: flex and specify that its items have to be center-aligned. Finally, you can also indicate how those list items need to be divided in the available space. In the example below I used justify-content: space-around.
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
nav {
background-color: white;
height: auto;
width: inherit;
margin-bottom: 0.5em;
border-bottom: 2px inset red;
}
nav ul {
list-style-type: none;
overflow: auto;
display: flex;
align-items: center;
justify-content: space-around;
}
nav ul li {
margin: 10px 20px 10px 10px;
text-align: center;
}
nav ul li:last-child {
margin-right: 10px;
}
nav ul li a {
text-decoration: none;
display: block;
height: 100%;
}
<header>
<nav>
<ul>
<li>
<img src="http://via.placeholder.com/100x100" alt="mylogo" style="width: 100px;height: 100px">
</li>
<li><span>APPS</span></li>
<li><span>CONTACT</span></li>
</ul>
</nav>
</header>

To horizontally align center use text-align: center; To vertically align you can use display: table-cell and vertically-align: middle;
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
nav {
background-color: white;
height: auto;
width: inherit;
margin-bottom: 0.5em;
border-top: 0px;
border-bottom: 2px;
border-left: 0px;
border-right: 0px;
border-style: inset;
border-width: auto;
border-color: red;
}
nav ul{
list-style-type: none;
overflow: auto;
text-align: center;
}
nav ul li{
display: inline-block;
margin-right: 20px;
height: 50px;
width: 100px;
margin: 10px;
text-align: center;
}
nav ul li a {
text-decoration: none;
display: table;
width: 100%;
height: 100%;
}
nav ul li a span{
display: table-cell;
vertical-align: middle;
width: 100%;
height: 100%;
}
<header>
<nav>
<ul>
<li><span><img src="https://www.seoclerk.com/pics/551103-1TOqFD1502285018.jpg" alt="mylogo" style="width: 40px;height: 40px"></span></li>
<li><span>APPS</span></li>
<li><span>CONTACT</span></li>
</ul>
</nav>
</header>

You can use display:inline on your list item and remove your current styling for you a tag as this will force all items to be 100% width of the screen. Also, add text-align:center to your ul and this should center your list:
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
nav {
background-color: white;
height: auto;
width: inherit;
margin-bottom: 0.5em;
border-top: 0px;
border-bottom: 2px;
border-left: 0px;
border-right: 0px;
border-style: inset;
border-width: auto;
border-color: red;
}
nav ul{
list-style-type: none;
overflow: auto;
text-align:center;
}
nav ul li{
display:inline;
margin-right: 20px;
height: auto;
width: auto;
margin: 10px;
text-align: center;
}
nav ul li a{
text-decoration: none;
}
<header>
<nav>
<ul>
<li><img src="logo.png" alt="mylogo" style="width: 100px;height: 100px"></li>
<li><span>APPS</span></li>
<li><span>CONTACT</span></li>
</ul>
</nav>
</header>
Hope this helps.

Use Flexbox. It's easier than anything and it can center your navigation elements vertically and horizontally at the same time.
nav {
background:#eee;
width:500px;
padding:10px;
box-sizing:border-box;
}
nav ul { /* this is the magical part */
display:flex;
justify-content:space-evenly;
align-content:center;
flex-flow:row wrap;
margin:0;
padding:0;
}
nav li {
list-style:none;
}
nav a {
display:block;
text-decoration:none;
background-color:#ccc;
padding:5px 20px;
}
a.logo {
display:block;
height:30px;
width:25px;
padding:0;
background:url("https://cdn.sstatic.net/Sites/stackoverflow/img/sprites.svg?v=1b3cdae197be") 0 -500px #ccc;
}
<nav>
<ul>
<li></li>
<li>item</li>
<li>item</li>
<li>item</li>
</ul>
</nav>

Related

Put Logo In Css Nav Bar

I want to know how to put a logo in my css navbar because I don't know how to put a logo in my css navbar. I have no clue on how to put the logo in the css navbar so it would be very nice if one of yall can help me out.
body {
margin: 0px;
}
ul {
list-style-type: none;
overflow: hidden;
margin: 0px auto;
background: #222;
padding: 0px;
}
li {
float: right;
font-size: 20px;
}
li a {
text-decoration: none;
color: white;
padding: 20px 20px;
display: block;
text-align: center;
}
ul li a:hover {
border-bottom: 3px solid grey;
padding-bottom: 17px;
}
img {
height: 70px;
}
<img src="https://oyster.ignimgs.com/mediawiki/apis.ign.com/minecraft/a/ad/Bat.png?width=325">
<ul>
<li>Contact</li>
<li>About</li>
<li>Home</li>
</ul>
The first thing you need to do is to create a columnar structure and have the background on the parent. And then add the logo to the left and links to the right. The best way to do is to use the <header> and <nav> tags as they are really semantic.
Here's something you might find useful:
body {
margin: 0px;
}
/* Add these */
header {
overflow: hidden;
background: #666;
}
header h1 {
float: left;
padding: 0 20px;
}
header nav {
float: right;
padding: 20px 0 0;
}
/* End Add these */
ul {
list-style-type: none;
overflow: hidden;
margin: 0px auto;
padding: 0px;
}
li {
float: left; /* Changed here. */
font-size: 20px;
}
li a {
text-decoration: none;
color: white;
padding: 20px 20px;
display: block;
text-align: center;
}
ul li a:hover {
border-bottom: 3px solid grey;
padding-bottom: 17px;
}
img {
height: 70px;
}
<header>
<h1>
<img src="https://oyster.ignimgs.com/mediawiki/apis.ign.com/minecraft/a/ad/Bat.png?width=325" />
</h1>
<nav>
<ul>
<li>Contact</li>
<li>About</li>
<li>Home</li>
</ul>
</nav>
</header>
Also, I just changed the background colour from #222 to #666 to keep it websafe and also make the logo visible. Feel free to change it.
Preview
Here is a fiddle that I hope will help you get you on the right track;
https://jsfiddle.net/Lyrw49mj/7/
HTML
<ul>
<li class="NavHeader"><a><img src="https://oyster.ignimgs.com/mediawiki/apis.ign.com/minecraft/a/ad/Bat.png?width=325"></a></li>
<li>Contact</li>
<li>About</li>
<li>Home</li>
</ul>
CSS
body {
margin: 0px;
}
ul {
list-style-type: none;
overflow: hidden;
margin: 0px auto;
background: #222;
padding: 0px;
}
li {
float: right;
font-size: 20px;
}
li a {
text-decoration: none;
color: white;
padding: 20px 20px;
display: block;
text-align: center;
}
ul li a:hover {
border-bottom: 3px solid grey;
padding-bottom: 17px;
}
.NavHeader a img{
position: relative;
top: 0px;
left: 0px;
height: 70px;
width: auto;
}
.NavHeader a:hover{
border-bottom: none;
padding-bottom: 20px;
}

Having trouble with the dropdown menu as its not appearing on hovering (just a html-css template)

I'm having trouble writing a code for a simple drop down menu but cant understand what I'm doing wrong still new to coding. Whenever I bring my cursor over the respective dropdown li tag the hover color effect is there but nothing comes down. In a previous attempt when the code was a a little different the list id appeared but it was in an inline manner and was align horizontally not vertically plz help.
#navbar {
background-color: #9C9C9C;
margin: 0px 200px 0px 200px;
height: 30px;
overflow: hidden;
}
#nav {
padding: 0px;
margin: 0px;
font-family: arial;
}
#main {
display: inline;
}
a {
display: block;
text-align: center;
float: left;
width: 100px;
padding: 3px;
line-height: 25px;
text-decoration: none;
color: white;
margin-top: 0px;
}
a:hover {
background-color: #d3d3d3;
color: black;
}
ul li ul li {
display: none;
}
ul li:hover ul li {
display block;
}
#searchbar {
margin: 5px 5px 0px 0px;
float: right;
}
<div id="navbar">
<div>
<ul id="nav">
<li id="main">Home</li>
<li id="main">Products</li>
<li id="main">More
<ul class="c">
<li class="B"><a id="A">Article1</a></li>
<li class="B"><a id="A">Article2</a></li>
<li class="B"><a id="A">Article3</a></li>
<li class="B"><a id="A">Article4</a></li>
</ul>
</li>
<li id="main">About US</li>
</ul>
</div>
<div id="searchbar"><input type="text" name="search" /><button id="button">GO</button></div>
</div>
First of all, you have id="main" applied to multiple elements. id is meant to be unique and applied to only one element.
Second, your hover effect was just a little incomplete. See my changes below.
#navbar {
background-color: #9C9C9C;
margin: 0px 200px 0px 200px;
height: 30px;
/*overflow: hidden; don't do this if you want dropdowns */
}
#nav {
padding: 0px;
margin: 0px;
font-family: arial;
}
#main {
display: inline;
}
#nav>li>a {
display: block;
text-align: center;
float: left;
width: 100px;
padding: 3px;
line-height: 25px;
text-decoration: none;
color: white;
margin-top: 0px;
}
#nav>li>a:hover {
background-color: #d3d3d3;
color: black;
}
#nav>li {
position: relative;
display: inline-block;
}
#nav>li ul {
display: none;
position: absolute;
}
#nav>li:hover ul {
display: block;
bottom: -80px;
padding: 10px;
left: 0;
min-width: 100px;
}
#searchbar {
margin: 5px 5px 0px 0px;
float: right;
}
<div id="navbar">
<div>
<ul id="nav">
<li>Home</li>
<li>Products</li>
<li>More
<ul class="c">
<li class="B"><a id="A">Article1</a></li>
<li class="B"><a id="A">Article2</a></li>
<li class="B"><a id="A">Article3</a></li>
<li class="B"><a id="A">Article4</a></li>
</ul>
</li>
<li>About US</li>
</ul>
</div>
<div id="searchbar"><input type="text" name="search" /><button id="button">GO</button></div>
</div>
you need to target ul li ul which you will show and hide ... and #main id can not be duplicate on the same page.. working example as below
#navbar {
background-color: #9C9C9C;
margin: 0px 200px 0px 200px;
height: 30px;
overflow: hidden;
}
#nav {
padding: 0px;
margin: 0px;
font-family: arial;
}
#main {
display: inline;
}
a {
display: block;
text-align: center;
float: left;
width: 100px;
padding: 3px;
line-height: 25px;
text-decoration: none;
color: white;
margin-top: 0px;
}
a:hover {
background-color: #d3d3d3;
color: black;
}
ul li{display: inherit;}
ul li ul {
display: none;
width: auto;
position: absolute;
top: 35px;
background: #ccc;
margin: 0;
padding: 0;
}
ul li ul li{display:block; list-style-type:none}
ul li:hover ul {
display: block;
z-index:1000;
}
#searchbar {
margin: 5px 5px 0px 0px;
float: right;
}
<div id="navbar">
<div>
<ul id="nav">
<li class="nestedchild">More
<ul class="c">
<li class="B"><a id="A">Article1</a></li>
<li class="B"><a id="A">Article2</a></li>
<li class="B"><a id="A">Article3</a></li>
<li class="B"><a id="A">Article4</a></li>
</ul>
</li>
<li id="main">About US</li>
</ul>
</div>
<div id="searchbar"><input type="text" name="search" /><button id="button">GO</button></div>
</div>
Your css should be like that.
.first .link {
color: black;
transform: rotate(-90deg);
width: auto;
border-bottom: 2px solid #FFFFFF;
position: relative;
top: 0vh;
}
.first {
background: green;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.menu {
background-color:red;
}
.bottom-line {
border-bottom:5px solid pink;
}
#navbar{
background-color: #9C9C9C;
margin: 0 auto;
padding: 30px 0;
width: 1200px;
}
#nav{
padding: 0px;
margin: 0px;
font-family: arial;
float: left;
list-style: none;
}
#main{
display: inline;
}
a{
display: block;
text-align: center;
float: left;
width: 100px;
padding: 3px;
line-height: 25px;
text-decoration: none;
color: white;
margin-top: 0px;
}
a:hover{
background-color: #d3d3d3;
color: black;
}
ul li {
float: left;
position: relative;
}
ul li ul {
display: none;
position: absolute;
list-style: none;
top: 32px;
z-index: 5;
background-color: #ddd;
padding-left: 0;
}
ul li:hover ul {
display: block;
}
#searchbar {
margin: 5px 5px 0px 0px;
float: right;
}
and You can also see demo here

Why does my drop down menu close when i try to use it

I'm trying to mimic this website (but with my own images): https://www.w3schools.com/w3css/tryw3css_templates_band.htm#
Every time I click on more to try to go down to "merchandise", "Extras" or "media" it closes (unless I do it very quickly). How can I fix this?
I know there's probably a better way of doing the drop-down menu in HTML/CSS but this is the only way I know how.
nav {
background-color: black;
height: 3rem;
widows: 100%;
}
.navbar {
height: 100%;
display: flex;
flex-flow: row wrap;
border: 1px solid hotpink;
justify-content: flex-start;
align-items: center;
}
.navbar li {
border: 2px solid green;
list-style-type: none;
height: 100%;
}
.navbar li a {
border: 1px solid orange;
color: white;
text-decoration: none;
padding: 0 20px;
text-transform: uppercase;
display: block;
height: 100%;
line-height: 2rem;
}
.navbar li a:hover {
background-color: #CCCCCC;
color: black;
display: block;
height: 100%;
}
section#header-image {
background-image: url('images/sky.jpg');
background-repeat: no-repeat;
background-size: cover;
background-position: center;
width: 100%;
height: 60vh;
display: flex;
flex-flow: column nowrap;
justify-content: flex-end;
align-items: center;
color: white;
}
.moreArrow{
height: 6px;
width: 8px;
margin-left: 5px;
}
ul li ul li {
display: none;
}
ul li:hover ul li {
display: block;
}
ul li:hover ul li a {
color: white;
background-color: black;
text-decoration: none;
padding: 0 20px;
height: 100%;
}
<header>
<nav>
<ul class="navbar">
<li>home</li>
<li>band</li>
<li>tour</li>
<li>contact</li>
<li>more<img src="images/arrow.png" alt="x" class="moreArrow">
<ul>
<li>Merchandise</li>
<li>Extras</li>
<li>Media</li>
</ul>
</li>
</ul>
</nav> <!--end of nav-->
<section id="header-image">
<div class="header-text">
<h2>London</h2>
<p>We killing it up in 'ere </p>
</div>
</section>
</header>
So, i made a lil change on your HTML, in order to persist ':hover' state you need to put anything that it has to stay visible inside the hovered item, in this case, a 'span' tag (i did changed from an 'a' tag because you cant nest 'a' tags)
The css is pretty simple from this point, you hide the sub menu and display on hover, anything that its inside the span tag belongs to ':hover' state as well
body {
margin: 0px;
}
nav {
width: 100vw;
height: auto;
border: 1px solid red;
}
nav ul.navbar {
display: flex;
margin: 0;
padding: 0;
}
nav ul.navbar > li {
width: auto;
display: inline-block;
vertical-align: top;
}
nav ul.navbar > li a {
display: inline-block;
text-decoration: none;
color: black;
border: 1px solid red;
padding: 10px 30px;
box-sizing: border-box;
width: auto;
}
nav ul.navbar > li span {
display: inline-block;
text-decoration: none;
color: black;
border: 1px solid red;
position: relative;
padding: 10px 30px;
}
nav ul.navbar > li span:hover ul {
display: inline-block;
}
nav ul.navbar > li span ul {
display: none;
margin: 0;
padding: 0;
position: absolute;
top: 38px;
left: 0px;
width: auto;
border: 1px solid blue;
}
nav ul.navbar > li span ul li {
display: inline-block;
list-style: none;
width: 100%;
}
nav ul.navbar > li span ul li a {
width: 100%;
display: inline-block;
}
<header>
<nav>
<ul class="navbar">
<li>home</li>
<li>band</li>
<li>tour</li>
<li>contact</li>
<li>
<span class="more">more
<ul rel=":D">
<li>Merchandise</li>
<li>Extras</li>
<li>Media</li>
</ul>
</span>
</li>
</ul>
</nav> <!--end of nav-->
</header>
Hope this helps

Positioning of ul in nav

I am trying to place Unsorted List in Navigation but I want it to be in the center of header-box.
<div class="header-box">
<nav>
<ul>
</ul>
</nav>
</div>
http://jsfiddle.net/9zWm9/7/ Here is the fiddle I am using same in my code.
First of all, clear your float.
EDIT: One of my friend has got real problems with div inside , so lets change this.
<div class="header-box">
<nav>
<ul>
<li>AASD</li>
<li>AASD</li>
<li>AASD</li>
<li style="visibility:hidden;opacity:0;height:0;width:0;clear:both"></li>
</ul>
</nav>
</div>
and the styles:
<style>
.header-box {
width: 400px;
height: 49px;
border: 1px solid green;
position: relative;
}
ul {
margin: 0 auto;
padding: 0;
text-align: center;
height: 100%;
margin: 13px auto;
}
nav li {
float: none;
list-style-type: none;
/* padding-left: 19px; */
/* margin-left: 20px; */
/* line-height: 50px; */
display: inline-block;
/* top: 0px; */
margin: 0 auto;
text-align: center;
}
</style>
Use text-align:center; for centering list's and padding for spaces and line-height for vertically center
FIDDLE
css
nav ul li{
display: inline;
list-style-type: none;
text-align:center;
padding:0 1px;
line-height:49px;
}
Please try this code. Working all Broswer
.header-box{
float:left;
width: 400px;
height: 49px;
border: 1px solid green;
position:relative;
}
.header-box nav {
float: right;
left: -50%;
position: relative;
display:block;
}
.header-box nav ul {
left: 50%;
list-style: none outside none;
margin: 0;
padding: 0;
position: relative;
}
nav li{
float: left;
list-style-type: none;
line-height: 50px;
padding:0 10px;
position: relative;
}
Working Demo
use margin: 0px auto;
.header-box{
width: 200px;
height: 49px;
border: 1px solid green;
}
nav li{
float: left;
list-style-type: none;
margin: 0px auto;
}
nav ul li{
float: left;
list-style-type: none;
margin: 0px auto;
padding-left: 19px;
}
nav ul {
width : 100%;
position:relative;
float:left;
margin-left:-25px;
}
nav li{
position:relative;
float: left;
margin-left:10px;
list-style-type: none;
}
Replace the CSS with following..
.header-box{
width: 400px;
height: 49px;
border: 1px solid green;
}
nav ul{
padding:0;
margin:0;
list-style:none;
text-align:center;
}
nav li{
display:inline;
}
THANKS
DEMO
.header-box{
width: 400px;
border: 1px solid green;
text-align:center;
}
nav ul{
padding:0;
}
nav li{
list-style: none;
display:inline-block;
margin-right: 10px;
vertical-align: middle;
}
Please update your css with below code which is with less modification :
.header-box{
width: 400px;
height: 49px;
border: 1px solid green;
text-align:center;
}
nav{
display:inline-block;
}
nav ul{
padding-left:0;
}
nav li{
float: left;
list-style-type: none;
padding-left: 10px;
padding-right: 10px;
}
nav ul li{
float: left;
list-style-type: none;
margin: auto;
padding-left: 20px;
position: relative;
}

How to create three columns in navigation submenu

I was able to successfully create a navigation menu with a submenu that appears on hover. However, I would like my submenus to have columns. I used Vanga Sasidhar's tips on creating the hover nav, I now need to create the columns under the Solutions and Support menu items.
Here is my jsfiddle: http://jsfiddle.net/DKu7p/.
Here is my CSS:
.site-nav li {
display:block;
float:left;
list-style:none;
margin: 0;
position: relative;
width: 100px;
}
.site-nav li:hover {
background:#1f78c3;
cursor:pointer;
}
.site-nav li a {
color:#696969;
display:block;
text-align:center;
text-decoration:none;
padding:5px 10px;
}
.site-nav li a:hover {
color:#00598B;
display:block;
text-align:center;
text-decoration:none;
padding:5px 10px;
}
.site-nav .dropdown {
display : none;
position : relative;
}
.site-nav .dropdown li { float : none; }
.site-nav li:hover .dropdown { display : block; position: relative; }
.dropdown {
background: #fff;
border: 1px solid #fff;
border-top: 0;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
list-style: none;
margin: 4px 0 0 -9px;
min-width: 150px;
overflow: hidden;
padding: 0;
position: relative;
z-index: 999;
}
.dropdown li {
border: 0;
border-radius: 0;
clear: both;
float: none;
font-size: .9em;
margin: 0;
width: 100%;
}
.dropdown li span {
display: none !important;
}
.dropdown li a {
background: none;
color: #333;
display: block;
font-size: 1.1em;
font-weight: normal;
padding: 5px 8px;
text-align: left;
text-shadow: none;
}
.dropdown li a:hover {
background: #ddd;
color: #0c84bb;
text-decoration: none;
}
.dropdown .last a {
border-bottom: none;
}
Ok, here my try:
Apply the three column css layout
.col-columned{
width: 450px;
}
.col-maincontainer{
width: 450px; /*Width of main container*/
margin: 0 auto; /*Center container on page*/
}
.col-maincontainer ul, .col-maincontainer ul{
margin: 0;
padding: 0;
list-style-type: none;
}
.col-contentwrapper{
float: left;
width: 100%;
}
.col-contentcolumn{
margin: 0 190px 0 180px; /*Margins for content column. Should be "0 RightColumnWidth 0 LeftColumnWidth*/
}
.col-leftcolumn{
float: left;
width: 150px; /*Width of left column in pixel*/
margin-left: -450px; /*Set margin to that of -(MainContainerWidth)*/
background: #C8FC98;
}
.col-rightcolumn{
float: left;
width: 150px; /*Width of right column*/
margin-left: -150px; /*Set left margin to -(RightColumnWidth)*/
background: #FDE95E;
}
.col-innertube{
margin: 3px; /*Margins for inner DIV inside each column (to provide padding)*/
margin-top: 0;
}
And then, add a new element with the html markout of three columns:
<a class="drop-link">Example1</a>
<ul class="dropdown col-columned">
<li>
<div class="col-maincontainer">
<div class="col-contentwrapper">
<div class="col-contentcolumn">
<div class="col-innertube">
<div class="wiki-tree">
<ul>
<li><a class="dropdown-title">topic1</a></li>
<li><a class="dropdown-title">topic2</a></li>
<li><a class="dropdown-title">topic3</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="col-leftcolumn">
<div class="col-innertube">
<div class="wiki-tree">
<ul>
<li><a class="dropdown-title">topic1</a></li>
<li><a class="dropdown-title">topic2</a></li>
<li><a class="dropdown-title">topic3</a></li>
</ul>
</div>
</div>
</div>
<div class="col-rightcolumn">
<div class="col-innertube">
<div class="wiki-tree">
<ul>
<li><a class="dropdown-title">topic1</a></li>
<li><a class="dropdown-title">topic2</a></li>
<li><a class="dropdown-title">topic3</a></li>
</ul>
</div>
</div>
</div>
</div>
</li>
</ul>
Make sure to add the col-columned to the dropdown element like this:
<ul class="dropdown col-columned">
Here the live example: http://jsfiddle.net/8fgG5/1/