inblog logo
|
harimmon
    CSS

    [CSS] 4. Flexbox로 요소 배치하기

    백하림's avatar
    백하림
    Mar 07, 2025
    [CSS] 4. Flexbox로 요소 배치하기
    <!DOCTYPE html> <html lang="en"> <head> <style> div { border: 1px solid black; padding: 20px; } .f-box { display: flex; justify-content: space-between; height: 500px; align-items: center; } </style> </head> <body> <div class="f-box"> <div>1</div> <div>2</div> <div>3</div> <div>4</div> <div>5</div> </div> </body> </html>
    .f-box { display: flex; justify-content: space-between; height: 500px; align-items: center; }
    notion image
    .f-box { display: flex; justify-content: center; height: 500px; align-items: end; }
    notion image
    💡
    이런 식으로 justify-content, align-items를 사용하여 위치를 잡아줄 수 있다.
    Share article

    harimmon

    RSS·Powered by Inblog