html - Mixed horizontal an vertical css with <menu><li> -


i'm trying creat menu mixed vertical horizontal items. that's how menu should like:

item 1    item 3    item 5    item 7
item 2    item 4    item 6    item 8

what tried ist following html:

<menu>       <li>item 1</li>     <li>item 2</li>     <li>item 3</li>     <li>item 4</li>     <li>item 5</li>     <li>item 6</li>     <li>item 7</li>     <li>item 8</li> </menu> 

and css:

.navigation menu {     float: right;     margin-top:103px;     width:683px;     } .navigation menu li {     display:block;     width: 115px;     float: none;     background-image:none;     text-align:right; } .navigation menu li:nth-child(3) {     float: left; } .navigation menu li:nth-child(4) {     float: none; } .navigation menu li:nth-child(5) {     float: left; } .navigation menu li:nth-child(6) {     float: none; } 

but doesn't work, think, it's css :)

anybody got idea? in advance help!

greetings est ro

keep odd elements floating left.

make elements have no width (margin-right: -115px) , position them 155 px left , apropiate distance bottom:

css

.menu {     float: left;     margin-top:13px;     width:683px;     } .menu li {     display:block;     width: 115px;     float: left;     background-image:none;     text-align:right; }  .menu li:nth-child(even) {     position: relative;     top: 1.2em;     left: -115px;     margin-right: -115px; } 

fiddle


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -