How to have two items on opposite sides on the same line

前端 未结 3 1779
一生所求
一生所求 2020-12-03 14:12

I\'m trying to get two different pieces of text on opposite ends of the \"page\" so to speak for a mobile app.

I would like it to look like this:

|--         


        
3条回答
  •  再見小時候
    2020-12-03 14:43

    Johannes Flexbox approach is probably the best way, but without using that, or float as you requested, you could do something like this:

    9 months 2 weeks ago

    And then:

    #HASH {
      width: 100%;
    }
    
    #HASH div {
      width: 49%;
      display: inline-block;
    }
    
    #right {
      text-align: right;
    }
    

    https://jsfiddle.net/ak7zxz84/

    Again, I'd go with Flexbox, but this is just an alternate solution.

提交回复
热议问题