WordPress.org

Ready to get started?Download WordPress

Forums

My divs cut off when browser is resized. (2 posts)

  1. novice21
    Member
    Posted 7 years ago #

    I can't say I understand this. This test page is an example of what I'm talking about. To see what I'm seeing simply resize the browser until a scroll bar comes up and scroll to the left. Why won't all the div boxes stretch to match the fixed width one?

    Using percentages instead of fixed width seem to solve this, but I don't recall having this problem before with fixed widths, what am I doing wrong people?

  2. jabecker
    Member
    Posted 7 years ago #

    Because the % on the div box is relative to the size of its container, not relative to the size of a box in a different container. The container is the size of your window. If you want the non-fixed-width boxes to never be narrower than the fixed-width box, you need to use the min-width property.

    Min-width is not valid in IE, but you can get around it by using this hack:
    width: expression(document.body.clientWidth < 300 ? "300px" );
    The number (in this case 300px) is the minimum width in pixels you want to allow for the box.

    You have an extraneous div tag up above your html header. I'm not sure why it's there, but you should remove it.

Topic Closed

This topic has been closed to new replies.

About this Topic