开发者

how to merge DIVs across li elements

<ul>
    <li>
       <div id='div1'><div>
       <div id='div2'><div>
    </li>
    <li>
       <div id='div3'><div>
       <div id='div4'><div>
    </li>
    <li>
       <div id='div5'><div&开发者_运维技巧gt;
       <div id='div6'><div>
    </li>
</ul>

Above html will design following design

 li li li
|__|__|__| -> odd DIVs
|__|__|__| -> even DIVs

I want to merge all the odd DIVs and place some text on the top of it.

 li li li
 |__|__|__| -> odd DIVs
 |__|__ __| -> even DIVs

Is there any way to do this?

Thanks


Try using this:

li {
    display: inline-block;
}
li div:last-child {
    display: inline;
}

Ive tested it in Firefox 5 only, and it seems to work.

See an example here http://jsfiddle.net/ffESR/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜