right alignment(right), with the Divs one below the other!

Asked

Viewed 45 times

-2

in a page I want to put a text to the left and four Ivs to the right, each div will be formatted to be visible in square format and within each div will have small texts with some icons. Okay, the text is already on the left and the Ivs are already on the right as in the image below, the only problem is that I want them to be below each other vertically, but when I gave the float, they lined up horizontally, I’ve tried some things I’ve found here and in other corners of the internet, but I haven’t succeeded in doing what I want. below the image, follow the html and css code of the page. ja esta quase como quero, so falta coloca-las uma abaixo da outra

<section id="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;*/
  • Try to put these Ivs inside another and align it on the right.

1 answer

0


There are several ways to solve this. For me the simplest is the one I will post below.

I basically took the float from the internal div and moved to the div "boxqtab" and limited the size of this div to the same size as the div "qtab" forcing them to be below each other.

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

.qtab {
    background-color: red;
    border: 1px solid;
    width: 100px;
    height: 100px;
}
  • I appreciate much brother, helped too much, even will help in other things in the same layout... solved...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.