HTML element display in horizontal line

后端 未结 4 1237
夕颜
夕颜 2021-02-19 07:08

I have two HTML elements inside a div. I want to display them in a row or a horizontal line. Let\'s say I have two images with the code shown below. How would I make it so there

4条回答
  •  南笙
    南笙 (楼主)
    2021-02-19 07:25

    The hack is to set position: relative; on the parent div and

    position: absolute; 
    top: 0px; 
    left: {left image's computed width}px; 
    

    on the second one. Other wise you simple increase the div size.

提交回复
热议问题