CSS side by side div with Pixel and Percent widths

后端 未结 7 976
半阙折子戏
半阙折子戏 2020-12-08 10:54

I have two div\'s (side by side) inside a parent div, i want right div to occupy 100% of remaining space (i.e. 100% - 200px) and should always stay next to left div (not bel

相关标签:
7条回答
  • 2020-12-08 11:53

    make the parent wrapper float. Also you would probably want to remove the width: 100% in the second child div. And have its width set by the amount of content inside. Or you could have percentage for both child divs. Example 30% and 70%.

    Demo here

    0 讨论(0)
提交回复
热议问题