Use max() to set the width of #div1 to whichever value is largest, 50% or 300px:
Resize the browser window to see the effect.