Moving elements in FlexBox

Joined
Jan 24, 2022
Messages
7
Reaction score
0
How would you move items anywhere in a flexbox?
I know the justify-content types of code, but what if I wanted to place a box in a random position inside the flex box?
 
Joined
Aug 23, 2022
Messages
1
Reaction score
0
You can specify the button's absolute location as follows:

Code:
#login_button {
    position: absolute;
    right: 10px;
    margin-top: 2px;
    border-radius: 5px;
    background-color: #ee5f95;
    width: 100px;
    height: 34px;
    text-align: center;
    border: none;
    font-family: "Ostrich Sans";
    font-size: 22px;
    color: white;
    line-height: 33px;
    transition: 0.7s;
    justify-content: flex-end;
}
 
Joined
Nov 13, 2020
Messages
302
Reaction score
38
position: absolute; in this case will be to the page. To make it work in the flex box the parent needs position: relative; in it's style.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top