开发者

Inline Unordered List

开发者 https://www.devze.com 2022-12-21 11:11 出处:网络
#results { font-family: arial, helvetica, sans-serif; list-style-type:none; } #results li {display: inline;}
#results {
font-family: arial, helvetica, sans-serif;
list-style-type:none;
}
#results li {display: inline;}
#results li a {
float:left;
 }

I would like the results division to list multiple items per line, but it looks like I am getting only 1 item per line with this code开发者_JAVA百科.


You need to give the ul margin: 0 and padding: 0 and the li a width: 49% for example (to leave some room for a margin-right).

#results {
font-family: arial, helvetica, sans-serif;
list-style-type:none;
margin: 0;
padding: 0;
}
#results li {
display: block;
float:left;
width: 49%;  /* Or whatever */
margin-right: 1%;  /* Or whatever */
}
#results li a {

 }


I will also add that I have another div within the results ul. It seems when I remove this inner division the results list horizontally.

<ul id="results">

<% for user in @users -%>
 <li>
<div id="short_profile">
 <.... ruby code ...>
 </div>
 </li>
 <% end -%>
 </ul>
0

精彩评论

暂无评论...
验证码 换一张
取 消