How can I do width = 100% - 100px in CSS?

前端 未结 18 845
借酒劲吻你
借酒劲吻你 2020-12-12 13:28

In CSS, how can I do something like this:

width: 100% - 100px;

I guess this is fairly simple but it is a bit hard to find examples showing

18条回答
  •  伪装坚强ぢ
    2020-12-12 13:47

    Working with bootstrap panels, I was seeking how to place "delete" link in header panel, which would not be obscured by long neighbour element. And here is the solution:

    html:

    
    

    css:

    .with-right-link { position: relative; width: 275px; }
    a.left-link { display: inline-block; margin-right: 100px; }
    a.right-link { position: absolute; top: 0; right: 0; }
    

    Of course you can modify "top" and "right" values, according to your indentations. Source

提交回复
热议问题