Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

css float right problem

  • 21-10-2008 02: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, Registered Users 2 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