How to place Text and an Image next to each other in HTML?

后端 未结 3 1219
情深已故
情深已故 2020-12-30 20:18

I want the text and the image to be next to each other but I want the image to be on the far left of the screen and I want the text to be on the far right of the screen. Thi

3条回答
  •  天涯浪人
    2020-12-30 20:58

    You can use vertical-align and floating.

    In most cases you want to vertical-align: middle, the image.

    Here is a test: http://www.w3schools.com/cssref/tryit.asp?filename=trycss_vertical-align

    vertical-align: baseline|length|sub|super|top|text-top|middle|bottom|text-bottom|initial|inherit;

    For middle, the definition is: The element is placed in the middle of the parent element.

    So you might want to apply that to all elements within the element.

提交回复
热议问题