Home >Web Front-end >HTML Tutorial >div block centered display_html/css_WEB-ITnose

div block centered display_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:59:261181browse




    
    
        #divbg
        {
            width: 98%;
            margin-left: auto;
            margin-right: auto;
        }
        #divbg li
        {
            float: left;
            background: rgb(231,231,231);
            width: 180px;
            height: 180px;
            font-size: 20px;
            list-style-type: none;
            cursor: hand;
            line-height: 40px;
            text-align: center;
            cursor: pointer;
            margin-bottom: 2%;
            margin-top: 4%;
            margin-left: 5.5%;
            margin-right: 5.5%;
        }
        #box
        {
            margin:0 0 0 0;
            position: absolute;
        }
    


    
    
    
        
            
                


  •                     

                            旅游
                            待审订单(<%= lvyou%>个)
                            待审团队(<%= tuandui%>个)

                            产品预订

                    

  •                 

  •                     

                            签证

                            待审订单(<%= qianzheng%>个)

                            产品预订

                    

  •                 

  •                     

                            订房

                            待审订单(<%= dingfan%>个)

                            产品预订

                    

  •                 

  •                     

                            门票

                            待审订单(<%= menpiao%>个)

                            产品预订

                    

  •                 

  •                     

                            租车

                            待审订单(<%= zuche%>个)

                            产品预订

                    

  •                 

  •                     

                            公文

                            待阅公文(<%= gongwen%>个)

                            
                        

                    

  •                 

  •                     

                            留言

                            待复留言(<%= liuyan%>个)

                            发布留言


  •                                                                                                                       " "CWCDayList.aspx">Pending financial affairs (<%= caiwu%>)


  •                                              🎜>



    The code is as above. The function I want is to display eight small blocks in the center. Initially, there are 4 in each row. The window shrinks and becomes larger. The small blocks among them also need to be centered. Small The block size is fixed at 180*180. I have been debugging the css for a long time, but I still can’t adjust it. . . .




    Reply to the discussion (solution)

    Is there anyone here? ? ? ? ?

    Don’t you think it looks better this way?

    Like the moderator. Correct answer upstairs.

    Previous article:How to put the displayed time on the left? _html/css_WEB-ITnoseNext article:How to put the displayed time on the left? _html/css_WEB-ITnose

    Related articles

    See more