Two column layout with left fluid and right fill the rest width

后端 未结 4 567
渐次进展
渐次进展 2021-01-25 09:13

I need something similar to this and this. However I want the right column not to be fixed size, but variable size. Is it possible?

––––––––––––––––––––––––––––         


        
4条回答
  •  清酒与你
    2021-01-25 09:46

    If a two-column-ish button is what you are after... (your ascii screenshot looks like this), so: diving the space in the best way but with one side winning, if it gets tight ➝ no truncated price, but truncated label if it has to be... ➪ full source on codepen

    125 €
    my favorite provider

    CSS (stylus)

    .container
        clearfix()
        border 2px solid purple
    
    .one, .two
        padding 4px
    
    .two
        background #aca 
        float right
        white-space nowrap
        text-overflow ellipsis
    
    .one
        background #caa 
        overflow hidden 
        white-space nowrap
        text-overflow ellipsis
    

提交回复
热议问题