right alignment, with the divs one below the other!

-2

In a page I want to put a text on the left and four divs on the right, each div will be formatted to be visible in square format and inside each div will have small texts with some icons. Well, the text is already on the left and the divs are already on the right as in the image below, the only problem is that I want them to be underneath each other vertically, but when I gave the float, they aligned horizontally , I already tried some things that I found here and in other corners of the internet, but I did not succeed in doing what I want. below the image, it follows the code html and css of the page.

<sectionid="quem">
            <br>
            <div id="boxqtab">
                <div class="qtab">
                </div>
                <div class="qtab">
                </div>
                <div class="qtab">
                </div>
                <div class="qtab">
                </div>
            </div>
            <div id="tquem">
                <p id="pquemtitulo">Quem Somos Nós</p>
                <br>
                <p id="pquem">Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.</p>
            </div>
            <!--<a href="#quem"><button  id="qbutton">Proxima Pagina</button></a>-->
        </section>


#quem {
    background-color: #6A5ACD;
    color: white;
    height: 100vh;
    margin-left: 300px;
}
#tquem {

}
.qtab {
    background-color: red;
    border: 1px solid;
    width: 100px;
    height: 100px;
    float: right;
}
/*#qbutton {
   background-color: blue;
    width: 200px;
    padding: 25px;
    border-radius: 20px;
    cursor: pointer; 
    margin-left: 50px;*/
    
asked by anonymous 23.11.2018 / 22:42

1 answer

0

There are several ways to resolve this. For me the simplest is the one I'll post below.

Basically, I took the float of the internal divs and went to the "boxqtab" div and I limited the size of that div to the same size as the "qtab" div forcing them to stay one below the other.

#boxqtab{
    width: 100px;
    float: right;
}

.qtab {
    background-color: red;
    border: 1px solid;
    width: 100px;
    height: 100px;
}
    
23.11.2018 / 23:34