I am trying to wrap a paragraph text to the next line when the browser-window is shrinked. Currently, it stays in the same place and a horizontal scroll bar appears when the browser window shrinks beyond the paragraph text.
I tried CSS3 text-wrap property but it didn’t work, or maybe I didn’t use it right.
Change this in your CSS:
Explanation:
Removing the
width: 928pxfrom#headerwill cause the header to become100%wide, which means “as wide as the browser, so shrink when the browser gets smaller”. Removing thewidth: 106%from#header-contentmakes it as wide as it’s parent#header.A side note: using widths that are more than 100% are generally a bad idea, they present strange layout issues that are hard to trace and usually it means that elements end up just outside the viewport, which is almost always undesirable.