对齐图例标记内的两个元素

Ale*_*lex 4 html css

如何将图像与文本对齐?

截图

<fieldset>
  <legend>
    <img src="http://www.placehold.it/50" width="50" height="50" />
    <label id="dettagli_ordine">Dettagli Ordine N° ${numero_ordine}</label>
  </legend>
</fieldset>
Run Code Online (Sandbox Code Playgroud)

Ale*_*har 5

您可以使用vertical-align: middle图像元素:

legend img {
  vertical-align: middle;
}
Run Code Online (Sandbox Code Playgroud)
<fieldset>
  <legend>
    <img src="resources/images/pacco.gif" width="50" height="50" />
    <label id="dettagli_ordine">Dettagli Ordine N° ${numero_ordine}</label>
  </legend>
  </fiedset>
Run Code Online (Sandbox Code Playgroud)