I'd like to make an element 400 px wide, if that fits the screen, and otherwise just give it the full width of the screen.
So I don't want the element to overflow beyond the screen.
How do I do this actually?
I've tried setting max-width to 400px, that works partly but it doesn't (of course) set the initial size. If I also put width=100% on it I notice that as I make the window smaller at a certain point the item starts (slightly) overflowing off the screen - it doesn't do that with only max-width set.