Ich habe ein Problem mit Layouten einiger Steuerelemente in einem Behälter mit Flex-Box.-Center ein Symbol und Text mit Flex-Box
Ich denke, es ist kein Flex-Box-Problem ist, aber mein Problem zu verstehen, warum das grüne Quadrat diese zusätzliche Höhe am Boden erhalten und den Text und die Zahl ebenfalls an der Spitze.
Es sollte in der Mitte zentriert werden, aber wo bekommen sie diese zusätzliche Höhe, die Zentrierung zu stören:
.fd-square-symbol::before {
content: '';
position: relative;
display: inline-block;
background-color: #98A92A;
width: 16px;
height: 16px;
outline: 1px dashed red;
vertical-align: top;
}
.fd-input-group {
display: flex;
align-items: center;
outline: 1px dashed red;
}
.fd-input-group__marker {
margin-right: 5px;
outline: 1px dashed blue;
}
.fd-input-group__number {
font-weight: bold;
outline: 1px dashed red;
}
.fd-input-group__label-column {
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
outline: 1px dashed red;
}
.fd-input-group__label-column-label {
outline: 1px dashed red;
}
.fd-info-button {
min-width: 20px;
height: 10px;
outline: 1px dashed red;
}
.fd-input-group__control-column {
display: inline-block;
flex-grow: 1;
outline: 1px dashed red;
}
<div class="fd-input-group">
<div class="fd-input-group__label-column">
<div>
<span class="fd-input-group__marker fd-square-symbol"></span>
<span class="fd-input-group__number">3.14</span>
<label class="fd-input-group__label-column-label">A question</label>
</div>
<button type="button" class="fd-info-button"></button>
</div>
<div class="fd-input-group__control-column">
<input type="text" value="a value" />
</div>
</div>
versuchten vertical-align Zugabe: oben nach dem grünen Quadrat? http://jsbin.com/qelafa/4/edit?css,output –
@Rachel S: Es tut etwas, das richtig aussieht. Aber warum gibt es die zusätzliche Höhe und warum beeinflusst Ihr Vorschlag auch den Text? – dec