ChrisJJ ChrisJJ - 1 year ago 61
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

Answer Source

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:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download