Split Div Into 2 Columns Using CSS

后端 未结 14 1851
故里飘歌
故里飘歌 2020-11-29 18:01

I have been attempting to split a div into two columns using CSS, but I have not managed to get it working yet. My basic structure is as follows:

14条回答
  •  执笔经年
    2020-11-29 18:50

    1. Make font size equal to zero in parent DIV.
    2. Set width % for each of child DIVs.

      #content {
          font-size: 0;
      }
      
      #content > div {
          font-size: 16px;
          width: 50%;
      }
      

    *In Safari you may need to set 49% to make it works.

提交回复
热议问题