text align right in a span

前端 未结 3 1169
南旧
南旧 2021-02-08 12:53

I am a little bit in doubt how I solve this the best way. In the footer of this page: Portfolio , there is the following:

04-11-2016 : Design In Portfolio

3条回答
  •  情书的邮戳
    2021-02-08 13:17

    Its contained inside a block element so add "float: right" to those spans to get your right alignment =).

    Edit. Someone shot down the float idea in a now deleted comment. Floating does present some layout ugliness for when your text on the left becomes too large. You could instead use a fancy flex solution that will hold up across different context a bit better.

    For flex, set the anchor to "display: flex" and the span to "flex: 1; text-align: right; white-space: nowrap;".

提交回复
热议问题