input { width: calc(100% - 8px); /* 8px to account for the default padding and border */ } .tag { float: right; margin-left: 1em; } input.tag { width: 7em; }