ChrisJJ ChrisJJ - 11 days ago 5x
CSS Question

Using CSS, how can align smaller text on right on the same baseline?

What change should I make to this:

<span style='font-size:400%'>left</span>

( ) to get 'right' to align right, but retain its vertical baseline alignment with 'left'?


<span style='font-size:400%'>left</span>
<span style='float:right'>right</span>

( need not apply:

enter image description here


Put it into a common container, like a div, to which you give these settings, using flexbox (the width can be anything):

.x {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 300px;

Here's the fiddle: