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