Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    <style>span {display: inline-block}</style>
    <span style="width: 250px"></span><span style="width: calc(100% - 250px)"></span>


When I was a kid (well, a less decrepit and slightly less old man) and there was no calc(), we did that sort of thing with padding-left, float, and negative margin-left.


not bad! calc and inline-block is fairly recent, right?


From memory, calc is IE9 and inline-block is IE6.

http://caniuse.com/ can answer these questions for you in general. If you're looking into newer layout techniques, you should also check out flexbox.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: