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.

Jquery fadeout box CSS problem

  • 13-03-2011 06:22PM
    #1
    Registered Users, Registered Users 2 Posts: 3,579 ✭✭✭


    Hi guys, I have a Ruby on Rails flash message that pops up on the bottom of my page then fades out using a jquery timeout, however the div(s) above it has a variable height so the flash msg text is appearing below the div but the actual border around it is appearing where the blue box is in the pic below, and I want it around the text below div1!
    xkj0M.jpg

    I've tried fiddling around with min/max-height and display block/inline, but none of them push the flash div border (included) down to the bottom no matter what height div1 is, any ideas?

    Here's my CSS:
    .div1{
    width: 900px;
    margin: auto;
    }

    .div2{
    float: left;
    width: 770px;
    font-size: small;
    margin: auto;
    background-color: #303030;
    border: 1px solid;
    border-color: #FFFFFF;
    padding: 10px;
    }

    .flash {
    text-align: center;
    width: 510px;
    height: 20px;
    margin-top: 15px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 5px;
    background-color: #303030;
    border: 1px solid;
    border-color: #FFFFFF;
    padding: 5px;
    }


Comments

  • Registered Users, Registered Users 2 Posts: 10,240 ✭✭✭✭Fanny Cradock


    Perhaps this is a problem with you not clearing your floats :confused:

    Did you try setting overflow:auto in #div1?


  • Registered Users, Registered Users 2 Posts: 3,579 ✭✭✭BopNiblets


    Clearing my floats? How do I do that? :p

    I'll try the overflow thing, but I'd prefer not to have the scrollbar.


  • Moderators, Category Moderators, Entertainment Moderators Posts: 36,711 CMod ✭✭✭✭pixelburp


    Clearing floats means that for the next element / block you wish to not be floated, you use the following:

    clear: both;

    So in your diagram above, if the left & right columns are floated (left and right), if you set clear: both on your flash div, it won't be part of the floated elements above. Does that make sense?


  • Registered Users, Registered Users 2 Posts: 3,579 ✭✭✭BopNiblets


    Yep, I'll try that, wasn't aware of that clear element.


Advertisement