Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Align two elements inside legend tag

Tags:

html

css

How can I align the image with the text?

Screenshot

<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>
like image 536
Alex Avatar asked Feb 11 '23 09:02

Alex


1 Answers

You can use vertical-align: middle to image element:

legend img {
  vertical-align: middle;
}
<fieldset>
  <legend>
    <img src="resources/images/pacco.gif" width="50" height="50" />
    <label id="dettagli_ordine">Dettagli Ordine N° ${numero_ordine}</label>
  </legend>
  </fiedset>
like image 175
Alex Char Avatar answered Feb 14 '23 00:02

Alex Char