Search code examples
csswidthcolumn-width

Div to Fill Remaining Width


enter image description here I'm trying to make this blue line (a div) automatically fill the rest of the space The width of the container is fixed to 800px but the h1 changes width depending on the length of the text.

About us

is longer than

Services

etc.

I can use something like 80% percent and it works but it doesn't fill the remaining and looks ugly...

How would you do that?

Thanks


Solution

  • You could simply make the line the width of the overall box but then hide the overflow:

    http://jsfiddle.net/yZ2KJ/