I diese hässliche Ausrichtung empfangen: Wie zentriert div und überspannt Elemente entlang der gleichen Linie?
I Text Spannweiten und div Rechtecken werden nicht vertikal in einer Linie zu sein, visuell zu zentrieren. Hier ist mein HTML-Code:
\t <div>
\t \t <div style="display: inline-block; background-color: lightgrey; height: 25px; width :40px; margin: auto;"> </div>
\t \t <span style="display:inline-block; font-size: 30px;">label1</span>
\t \t <span style="display:inline-block; width: 50px;"> </span>
\t \t
\t \t <div style="display: inline-block; background-color: lightgrey; height: 25px; width :40px; margin: auto;"> </div>
\t \t <span style="display:inline-block; font-size: 30px;">label2</span>
\t \t <span style="display:inline-block; width: 50px;"> </span>
\t \t
\t \t <div style="display: inline-block; background-color: lightgrey; height: 25px; width :40px; margin: auto;"> </div>
\t \t <span style="display:inline-block; font-size: 30px;">label3</span>
\t </div>
ich nicht die Art und Weise wie verwenden kann "paddind-bottom: 5px;" weil ich diesen HTML-Code programmatisch und Schriftgröße sowie div Breite und Höhe häufig ändert. Meine Frage ist also, wie man meine Elemente unabhängig von ihrer Größe in die richtige Richtung bringt?
vertical-align: top –