Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有十件物品。我如何做到两行,每行有五个项目?
HTML:
<ul> <li>item1</li> <li>item2</li> //... <li>item5</li> //newline <li>item6</li> <li>item10</li> <ul>
CSS:
ul li { display: inline-block; }
注意,我必须使用inline-block而不是inline.
inline-block
inline
你可以试试这个
$( "ul li" ).eq( 4 ).after( "<br />" );
演示