How do I float two divs side-by-side without specifying a width?

前端 未结 3 1994
孤独总比滥情好
孤独总比滥情好 2021-01-31 21:38

I have two divs, the first doesn\'t have much content and the second has a lot of content. I want them to float side-by-side such that the first div is only as wide as the text

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-31 22:02

    Try this :

    content
    content

    Or

    refer this : How to style Div elements as Tables

    
    
    table using divs
    
    
    
    
    This is a caption
    1st Column
    2nd Column

    Note : To use these CSS property values, you need to have a web browser which supports them. Unfortunately, that translates to a limited number of web browsers such as IE 8, Firefox 3, Opera 9 and so on

提交回复
热议问题