Question

I'm a css noob, and though I want this DIV to resize when the window is resized, I don't want inner content to change the size of it.

Was it helpful?

Solution

Use the overflow statement. e.g.

overflow: hidden; /* all content hidden as it spills over */

overflow: auto; /* Scroll bars appear on div when required to allow moving around */

overflow: scroll; /* Scroll bars will be present at all times */

OTHER TIPS

Try using:

div {
  overflow: hidden;
}

Read more here.

set overflow: hidden on the containing div

Have you looked into CSS and the overflow directive? You can use this to tell the div to scroll or truncate/hide its content when the content is too large.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top