๐ŸณCoding apple HTML/CSS All-in-one : ๊ธฐ์ดˆ๋ถ€ํ„ฐ Bootstrap, SASS, ๊ณ ๊ธ‰ animation ๊นŒ์ง€ ๊ฐ•์˜๋ฅผ ๋ณด๊ณ  ์ •๋ฆฌํ•œ ๊ธ€์ž…๋‹ˆ๋‹ค ๐Ÿณ

๐Ÿ’ซ display : inline-block ์‚ฌ์šฉ ๋ฒ•

๊ฐ€๋กœ๋กœ ์ •๋ ฌํ•  ๋•Œ display : inline-block์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ๋„ ๊ฐ€๋Šฅ

<div>
  <div class="left-box"></div><div class="right-box"></div>
</div>
.left-box {
  width : 100px; 
  height : 100px;
  display : inline-block;
}
.right-box {
  width : 100px; 
  height : 100px;
  display : inline-block;
}

display ์†์„ฑ๋งŒ inline-block์œผ๋กœ ์กฐ์ •ํ•˜๋ฉด ๊ฐ€๋กœ๋กœ ๋ฐฐ์น˜๊ฐ€ ๊ฐ€๋Šฅ
inline- block์€ "๋‚ด ํญ๊ณผ ๋†’์ด๋งŒํผ ์ž๋ฆฌ ์ฐจ์ง€ํ•˜๊ฒŒ ํ•ด์ฃผ์„ธ์š”~" ๋ผ๋Š” ๋œป
๊ฐ„ํŽธํ•˜์ง€๋งŒ <ํƒœ๊ทธ> ์‚ฌ์ด์— ์ŠคํŽ˜์ด์Šค๋ฐ” ๊ณต๋ฐฑ์ด ์žˆ๋‹ค๋ฉด ๊ทธ๋Œ€๋กœ ๋ณด์—ฌ์ฃผ๊ธฐ ๋•Œ๋ฌธ์— ๊ฐ€๋กœ๋กœ ์ •๋ ฌํ•˜๋ ค๋ฉด ํƒœ๊ทธ ์‚ฌ์ด์˜ ๊ณต๋ฐฑ๋„ ์ œ๊ฑฐํ•ด์ค˜์•ผ ํ•จ
ย 

โญ ๊ณต๋ฐฑ ์ œ๊ฑฐ ํŽธ๋ฒ• 1. ์ฃผ์„ ์ฒ˜๋ฆฌ ๊ธฐํ˜ธ ์‚ฌ์šฉํ•˜๊ธฐ

<div>
   <div class="left-box"></div><!--
--><div class="right-box"></div>
</div>

โญ ๊ณต๋ฐฑ ์ œ๊ฑฐ ํŽธ๋ฒ• 2. ๋ถ€๋ชจ์˜ ํฐํŠธ ์‚ฌ์ด์ฆˆ๋ฅผ 0์œผ๋กœ ๋งŒ๋“ค๊ธฐ

<div style="font-size : 0px;">
    <div class="left-box"></div>
    <div class="right-box"></div>
</div>

ย 

๐Ÿ’ซ ์˜ค๋Š˜์˜ ์ˆ™์ œ : ์•„๋ž˜ ์‚ฌ์ง„๊ณผ ๋น„์Šทํ•˜๊ฒŒ ๋งŒ๋“ค์–ด์˜ค๊ธฐ


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link href="css/a.css" rel="stylesheet">
</head>
<body>
    <div class="test">
        <div class="header">
            <div class="header1"><img src="img1.jpg" class="img1"></div>
            <div class="header2">
                <h2>์ฟ ๋กœ๋ฏธ</h2>
                <p>2์‹œ๊ฐ„์ „</p>
            </div>
        </div>
        <div class="left">
            <h3>๋งˆ์ด๋ฉœ๋กœ๋”” ์„ธ๊ณ„๊ด€</h3>
            <p>์„ฑ๋ณ„: ์—ฌ์„ฑ</p>
            <p>์„ฑ๊ฒฉ: ์‚ฌ์‹ค์€ ์—„์ฒญ ์—ฌ์„ฑ์Šค๋Ÿฌ์›€!?</p>
        </div>
        <div class="right">
            <img src="img1.jpg" height="100%" width="100%">
        </div>
        <div class="footer"></div>
    </div>
</body>
</html>
.test{
    width: 500px;
    height: 150px;
}

.header{
    /* margin-top: 15px; */
    width: 100%;
    height: 40%;
    /* background-color: aqua; */
    float: left;
}

.left{
    width: 85%;
    height: 55%;
    /* background-color: rgb(153, 195, 197); */
    float: left;
    line-height: 40%;
}

.right{
    width: 15%;
    height: 55%;
    /* background-color: green; */
    float: left;
}

.footer{
    width: 100%;
    height: 5%;
    /* background: grey; */
    clear:both;
}

.header1{
    width: 14%;
    height: 100%;
    float: left;
}

.header2{
    width: 86%;
    height: 100%;
    line-height: 40%;
    float: left;
    padding-left: 10px;
    box-sizing: border-box;
}

.img1{
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

By Dozzing

๋‹ต๊ธ€ ๋‚จ๊ธฐ๊ธฐ

์ด๋ฉ”์ผ ์ฃผ์†Œ๋Š” ๊ณต๊ฐœ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ํ•„์ˆ˜ ํ•„๋“œ๋Š” *๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค