Space above text that is next to a image

前端 未结 4 527
轻奢々
轻奢々 2021-01-24 18:05

\"image\"As you can see. I have space above header 3, I want it to be inline with the image itself.

HTML



        
4条回答
  •  执念已碎
    2021-01-24 18:48

    If you set both elements to inline-block they will set side but side and you have more control than when floating the item - just remember to remove any white space between tags.. Just change the top margin to 0, and you don't need any unit when the value is 0.

    .content > img, .content > h3 { display: inline-block; margin-top: 0; vertical-align: top;}
    

提交回复
热议问题