Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Float boxes vertical alignment

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #23596
    Luigino
    Member

    Hello everyone!!!!

    I have a piece of code like this:

    <div id="rispostasingola">
    <div id="testorisposta"><p align="left"><? echo $terza_risposta ?></p>
    </div>
    <div id="verofalso">
    <ol>
    <li><input type="radio" name="risposta3" value="0" class="styled" checked="checked"/></li>
    <li><input type="radio" name="risposta3" value="1" class="styled" /></li>
    </ol>
    </div>
    </div>

    and his relative CSS:

    #rispostasingola {
    height: 100%;
    border: 1px solid black;
    }

    #testorisposta {
    float: left;
    /*height: 100%;*/
    width: 78%;
    /*border: 1px solid #EFEFF7;*/
    border: 1px solid red;
    }

    #verofalso {
    float: right;
    margin-left: 640px;
    height: 20px;
    border: 1px solid green;
    }

    #verofalso ol
    {
    margin: 0;
    padding: 0;
    width: 110px;
    list-style: none;
    }

    #verofalso li
    {
    float: left;
    display: inline;
    margin-left: 12px;
    margin-right: 15px;
    padding-left: 2px;
    padding-right: 4px;
    text-align: bottom;
    }

    and I want as result those floated boxes aligned on top so when the "answer" is like more longer at least the radio buttons remains aligned to the start of the "answer" but I get as result as in the attached image…
    Anyone has a suggest for a solution?

    Thanks a lot to everyone
    Ciao!
    Luigi

    #51245
    Luigino
    Member

    Solved!!

    the margin-left css property wasn’t really adapt for it so I substituted it with a fixed width: 40px and it went to top.

    If the solution helps someone…..

    Thanks anyway to all
    Ciao
    Luigi

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.