how to cut off the bottom of a page with css or html?

Discussion in 'Web Design and Development' started by theprizefight, Jan 7, 2009.

  1. theprizefight macrumors member

    Joined:
    Oct 29, 2006
    #1
    On a design I am working on, I have some extra whitespace at the bottom of the page (maybe 200 pixels or so, which extends below my page background). The whitespace is due to using some relative positioning, and moving some DIV's above where the actually should be.

    My question is, is there any type of CSS command, or HTML command, that will tell the browser to cut off the page a certain number of pixels before it actually ends?

    Thanks in advance.
     
  2. hobbbz macrumors 6502a

    hobbbz

    Joined:
    Mar 8, 2005
    #2
    Link? It's hard to tell just based on a description.
     
  3. hobbbz macrumors 6502a

    hobbbz

    Joined:
    Mar 8, 2005
    #3
    Make that containing DIV's overflow:hidden and then give it a fixed height

    Also, I would make that background always centered like the middle white box is and set it all on a blue background color instead of the white.
     
  4. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #4
    Wrap all content in a single div with an ID. Set its height and width to whatever you want in pixels in the associated CSS also add in the following:

    overflow: hidden;

    Notes:

    A full explanation of overflow is found here.

    As to positioning elements, anything outside the "flow" will display no matter what you do. If you position objects in this manner, then apply the height/width and overflow to the body tag in your CSS but -- I've never tried that so test it carefully. If all else fails, resort to creating an iframe and set the scrolling=no, but it's your last resort, a horrible way to do it. The best fix is NOT to position any elements outside the flow, keeps things very simple and the method I listed first works great.

    -jim
     
  5. Yvan256 macrumors 601

    Joined:
    Jul 5, 2004
    Location:
    Canada
    #5
    Haven't seen exactly what you mean, but remember that web pages are displayed in a lot of different browsers, on a lot of different operating systems, and (especially) a LOT of different screen resolutions.
     
  6. Melrose Suspended

    Melrose

    Joined:
    Dec 12, 2007
    #6
    If I understand your problem accurately, I've had the same problem before (well, once before). I forget how I resolved now, but I seem to remember it was something related to float and width of certain elements.
     

Share This Page