The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] float right not working correct Reply To: [Solved] float right not working correct


It’s because you are floating it right…it’s no longer inline so it’s sitting a the top of the block….which is what you have,in effect, told it to do.

The block height, in the absence of any other factors is probably c.1.2em…the line-height

If you add that to the span it’s looks right.

Codepen Link

Personally, I would probably gone the absolute position route on the span and that would enable me to position it correctly and use transform:translate to keep it there regardless of the parent height. It’s an option.