Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

css float right problem

Options
  • 21-10-2008 2:54pm
    #1
    Closed Accounts Posts: 184 ✭✭


    Im trying to make a column on the right that will expand the full height of the webpage something like this.

    .sidebar
    {
    float: right;
    height: 100%;
    width: 200px;
    }

    Not having any luck as yet, any suggestions? Also I haven't defined a height in the container div as I don't want the page content to escape the page boundaries, but rather expand to fit it.


Comments

  • Registered Users Posts: 8,488 ✭✭✭Goodshape


    Any more code you can show us (html and css)?

    A link to the page would be better again.


  • Closed Accounts Posts: 18,163 ✭✭✭✭Liam Byrne


    It's not actually a "float:right" problem. It's a general CSS thing, and the "100%" has to be "100%" of something (its parent container).

    Normally, this type of stuff is handled 2 ways:

    1) If you just need a column or background to run down the screen, put that background on the parent (do a search for CSS columns to find how to do this)

    2) Add JavaScript or jQuery (which can do it the very second the page DOM loads, before window.load) to check the actual content height of the parent and set the height of the floated div


Advertisement