How to style dt and dd so they are on the same line?

后端 未结 18 2255
滥情空心
滥情空心 2020-11-27 10:12

Using CSS, how can I style the following:

Mercury
Mercury (0.4 AU from the Sun) is the closest planet to th
18条回答
  •  迷失自我
    2020-11-27 10:49

    I've found a solution that seems perfect to me, but it needs extra

    tags. It turns out that it is not necessary to use tag to align as in a table, it suffices to use display:table-row; and display:table-cell; styles:

    
    
    
    Mercury
    Mercury (0.4 AU from the Sun) is the closest planet to the Sun and the smallest planet.
    Venus
    Venus (0.7 AU) is close in size to Earth, (0.815 Earth masses) and like Earth, has a thick silicate mantle around an iron core.
    Earth
    Earth (1 AU) is the largest and densest of the inner planets, the only one known to have current geological activity.

    提交回复
    热议问题