一行排奇数列的HTML排版

<%if (listno != null)
              { %>
            <div class="MissWContent box">
                <%if (listno.Count > 0)
                  { %>
                <div class="hgl_title box">
                    <h2>Title</h2>
                    <div>Title Description</div>
                </div>
                <!--one block start-->
                <div class="xiaowenzi_body box">
                    <%
                        int loop = 2;//一行3个
                        for (int i = 0; i < listno.Count; i++)
                        {
                            if (i == loop)
                            {
                                loop += i+1;
                    %>
                    <div class="xiaowenzi_item box" style="margin-right: 0px;">
                        <%}
                            else
                            {
                                %>
                        <div class="xiaowenzi_item box">
                            <%} %>
                            <a href='/xiaowenzi/<%=listno[i].KID %>' target="_blank">
                            <div class="item_pic box">
                                    <img src='<%=listno[i].KImg %>' alt='<%=listno[i].KName %>' />
                            </div>
                            <div class="item_title">
                                    <%=listno[i].KName %>
                            </div>
                            </a>
                        </div>
                        <%
                            }
                        %>
                    </div>
                    <div>
                    <a class="more" href="/words" title="其他文字">Other words……</a>
                    </div>
                    <!--one block end-->
                    <%} %>
                </div>
                <%} %>

 

posted @ 2015-11-02 21:06  阿猫小覃  阅读(343)  评论(0编辑  收藏  举报