CSS to stop text wrapping under image

后端 未结 6 1292
栀梦
栀梦 2020-12-02 04:18

I have the following markup:

  • Text, text and more text
  • 6条回答
    •  轻奢々
      轻奢々 (楼主)
      2020-12-02 05:02

      Wrap a div around the image and the span and add the following to CSS like so:

      HTML

              
    • Text, text and more text
    • CSS

                  #CN2787 > div { 
                      display: inline-block;
                      vertical-align: top;
                  }
      
                  #CN2787 > div:first-of-type {
                      width: 35%;
                  }
      
                  #CN2787 > div:last-of-type {
                      width: 65%;
                  }
      

      LESS

              #CN2787 {
                  > div { 
                      display: inline-block;
                      vertical-align: top;
                  }
      
                  > div:first-of-type {
                      width: 35%;
                  }
                  > div:last-of-type {
                      width: 65%;
                  }
              }
      

    提交回复
    热议问题