width, height, margin, padding ěěąě ě§ě í ě ěë¤
ol, ul, li, hr, table, form ëą
width, height, margin-top, margin-bottom, padding-top, padding-bottom ěěąě ě§ě í ě ěë¤.
margin-left, margin-right, padding-left, padding-right ěěąě ě§ě ę°ëĽíë¤.
ě, í ěŹë°ąě line-height
ëĄ ě§ě í ě ěë¤.
a, img, br, input, select, textarea, button ëą
inline ë 벨 ěěě˛ëź, contentě ëëšë§íź ę°ëĄíě ě°¨ě§íë¤.
block ë 벨 ěěě˛ëź, width, height, margin, padding ěěąě 모ë ě§ě í ě ěë¤.
ě, í ěŹë°ąě marginęłź line-height ë ę°ě§ ěěą ëŞ¨ë뼟 ě´ěŠí´ ě§ě ę°ëĽíë¤.
<div> <div class="container one"> <div>ěěě</div> <div>ě 기í´</div> </div> <div class="container two"> <div>ë°°ęł í</div> <div>ě§ě§ëĄ</div> </div> </div>
.container div { display: inline-block; border: 2px solid sienna; width: 300px; vertical-align: middle; } .container div:first-child { height: 70px; } .container div:nth-child(2) { height: 150px; } .two { font-size: 0; } .two div { font-size: 20px; }
â [ęłľě ] Vertical-align íí¤ěšę¸°! â 1ëś ě°¸ęł
vertical-align
â inline-block ëąě íŹí¨í 모ë inline ěěě ěě§ ě ë Źě ěí´ ěŹěŠë¨vertical-align: middle;
â í´ëš ěěě ě¸ëźě¸ ë°ě¤ě ěě§ ě¤ě ě§ě ě, ꡸ ëśëި ěěě ě¤ě ě§ě ě ě ë Ź
visibility: hidden;
â í´ëš ěě뼟 ëł´ě´ě§ ěę˛ íě§ë§, í´ëš ěěě ęłľę°ě ë¨ě ěę˛ ëë¤
display: none;
â í´ëš ěě뼟 ëł´ě´ě§ ěę˛ í늰, í´ëš ěěě ęłľę°ë ěŹëźě§ę˛ ëë¤
0.0(íŹëŞ ) ~ 1.0(ëśíŹëŞ ) ěŹě´ě ę°ě ę°ě§ë¤
:hoverě ě ěŠ ę°ëĽ
1) background-image
: url("");
2) background-repeat
: repeat(기본ę°) / repeat-x / repeat-y / no-repeat;
3) background-size
4) background-attachment
<html> <body> <div class="image one"> <div class="lorem"> Lorem ipsum dolor sit amet consectetur adipisicing elit. Iure debitis itaque aut quasi. Aspernatur, perspiciatis nisi officiis fugiat quod at ipsam quos, nulla cum itaque dolorum eveniet sunt delectus ratione? Lorem ipsum dolor sit amet consectetur adipisicing elit. Aspernatur distinctio repudiandae neque error a quo repellendus porro optio voluptatibus obcaecati illum similique debitis, quam ab beatae atque pariatur modi odit! Odit alias earum accusamus nesciunt quo iure dolores odio. Ex, repellat aspernatur laborum necessitatibus recusandae, obcaecati praesentium quam quisquam doloribus voluptatum quos soluta laboriosam consectetur tempora distinctio modi aliquid sed. </div> </div> <div class="image two"></div> </body> </html>
html, body { width: 100%; height: 100%; } .image { height: 100%; background-repeat: no-repeat; background-size: cover; overflow: auto; } .one { background-image: url("https://cdn.pixabay.com/photo/2021/07/18/18/36/tree-6476331_960_720.jpg"); background-attachment: fixed; } .two { background-image: url("https://cdn.pixabay.com/photo/2020/12/16/14/56/farm-5836815_960_720.jpg"); } .lorem { background-color: white; width: 400px; margin: 100px auto; padding: 20px; font-size: 18px; }
đââď¸ Q1.
overflow: auto;
뼟 ě ěŠí늴 í ě¤í¸ ěëśëś 배경 ě´ëŻ¸ě§ę° ě ëěë¤ę° ę°ě기 ëě¨ë¤. ě´ ěěąę°ě ě¤íŹëĄ¤ ë°ëĽź ë§ë¤ě´ěŁźë ę˛ ěëę°. ěŹę¸°ě ëŹ´ě¨ ę´ęłę° ěë ęą´ě§ ëŞ¨ëĽ´ę˛ ë¤.đââď¸ Q2. íě´ëĽź 보늴 CSS 맨 ěě ě´ę˛ ěśę°ëě´ ěë¤. ěŹę¸°ě ě ěěąę°ě :after, :befor ě íěě ě ěŠí ě´ě ę° ëęš.
*, *:after, *:before { margin: 0; padding: 0; box-sizing: border-box; }
5) background
: color | image | repeat | attachment | position
font-family
font
line-height
letter-spacing
text-align
<a>
ě ę°ě inline ë 벨 ěěěë text-align: center;
뼟 ě§ě í´ë ę°ě´ë° ě ë Źě´ ěźě´ëě§ ěëë¤. inline ë 벨 ěěë width ěěąě ę°ě§ ëŞťí´ ě¤ě ę°ë
ě´ ěĄ´ěŹíě§ ě기 ë돸ě´ë¤. inline ë 벨 ěě뼟 ě¤ě ě ë Źí기 ěí´ěë 먟ě display: block;
ëąě ě§ě í´ block ë 벨 ěěëĄ ë°ęż 죟ě´ěź íë¤.git, github
Google Clone