'Position 2 texts same height

Trying to position "Certamente não" and "Certamente Sim" at the same height.

Using margin top doesn't seem to align them correctly.

enter image description hereenter image description hereenter image description here



Solution 1:[1]

You can use "flexbox" to align them. For example:

.parent {
  display: flex;
  align-items: center;
}

<div class="parent">
  <span>Certamente não</span>
  <span>Certamente Sim</span>
</div>

Learn more about flexbox: https://css-tricks.com/snippets/css/a-guide-to-flexbox/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ahmet Zambak