html - How to align every two <li> next to each other -


i trying align every 2 li elements side side (like : 0-9, a-b, c-d, ...). currently, aligned one-by-one.

<ul>     <li class="alphabetrow"><a href="#" id="alpha_1" class="alphabet active" >0-9</a></li>     <li class="alphabetrow"><a href="#" id="alpha_2" class="alphabet" >a</a></li>     <li class="alphabetrow"><a href="#" id="alpha_3" class="alphabet" >b</a></li>     <li class="alphabetrow"><a href="#" id="alpha_4" class="alphabet" >c</a></li>     <li class="alphabetrow"><a href="#" id="alpha_5" class="alphabet" >d</a></li>     <li class="alphabetrow"><a href="#" id="alpha_6" class="alphabet" >e</a></li>     <li class="alphabetrow"><a href="#" id="alpha_7" class="alphabet" >f</a></li>     <li class="alphabetrow"><a href="#" id="alpha_8" class="alphabet" >g</a></li>     <li class="alphabetrow"><a href="#" id="alpha_9" class="alphabet" >h</a></li>     <li class="alphabetrow"><a href="#" id="alpha_10" class="alphabet" >i</a></li>     <li class="alphabetrow"><a href="#" id="alpha_11" class="alphabet" >j</a></li>     <li class="alphabetrow"><a href="#" id="alpha_12" class="alphabet" >k</a></li>     <li class="alphabetrow"><a href="#" id="alpha_13" class="alphabet" >l</a></li>     <li class="alphabetrow"><a href="#" id="alpha_14" class="alphabet" >m</a></li>     <li class="alphabetrow"><a href="#" id="alpha_15" class="alphabet" >n</a></li>     <li class="alphabetrow"><a href="#" id="alpha_16" class="alphabet" >o</a></li>     <li class="alphabetrow"><a href="#" id="alpha_17" class="alphabet" >p</a></li>     <li class="alphabetrow"><a href="#" id="alpha_18" class="alphabet" >q</a></li>     <li class="alphabetrow"><a href="#" id="alpha_19" class="alphabet" >r</a></li>     <li class="alphabetrow"><a href="#" id="alpha_20" class="alphabet" >s</a></li>     <li class="alphabetrow"><a href="#" id="alpha_21" class="alphabet" >t</a></li>     <li class="alphabetrow"><a href="#" id="alpha_22" class="alphabet" >u</a></li>     <li class="alphabetrow"><a href="#" id="alpha_23" class="alphabet" >v</a></li>     <li class="alphabetrow"><a href="#" id="alpha_24" class="alphabet" >w</a></li>     <li class="alphabetrow"><a href="#" id="alpha_25" class="alphabet" >x</a></li>     <li class="alphabetrow"><a href="#" id="alpha_26" class="alphabet" >y</a></li>     <li class="alphabetrow"><a href="#" id="alpha_27" class="alphabet" >z</a></li>   </ul> 

fiddle: https://jsfiddle.net/g8jzgzev/1/

you mean this. https://jsfiddle.net/g8jzgzev/4/

ul {   list-style-type: none;   overflow: hidden; } li {   float: left; } li:nth-child(2n) {   clear: left; } 

float them , clear every third one.


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -