์ฃผ๋ง๋์ ๋ฉ์์ด ์ฌ์์ฒ๋ผ ํ๋ก ํธ ์๋ ์ค์ฟจ์์ ๊ฐ๋จํ ๊ณผ์ ๋ฅผ ๋ฐ์์ต๋๋ค!.
๋ฐ์ค ๊พธ๋ฏธ๊ธฐ ์ธ๋ฐ์.
ํ๋ฒ ๋ค์ด๊ฐ ๋ณด๊ฒ ์ต๋๋ค.
1๋ฒ์งธ ๋ฐ์ค ๋ถํฐ ์์ํด ๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค.
2๋ฒ ์งธ ์ฌ์ง์ ๋ณด์๋ฉด 3๊ฐ์ง์ ์์ ๊ฐ๋ ๊ฒ์ ๋ณผ ์ ์์ต๋๋ค.
๊ฒ์ ๊ฒ์ ํ ๋๋ฆฌ๋ border๋ฅผ ์ค์ ๋ง๋ค ์ ์์ ๊ฒ ๊ฐ์๋ฐ ์ค๊ฐ์ ํ์ ๋ถ๋ถ์ ์ด๋ป๊ฒ ํ ์ง ๊ฐ์ด ์ ์ค์ง ์์์ต๋๋ค.
๊ทธ๋์ ๊ณ ๋ฏผํ ๊ฒฐ๊ณผ div์์ div๋ฅผ ๋ฌ์ ๋ฐ๋ก border๋ฅผ ์ฃผ๋๊ฒ ๋ฐ์ ์๊ฐ์ด ๋์ง ์์ ๊ทธ๋ฐ ์์ผ๋ก ๊ตฌํํด ๋ณด์์ต๋๋ค.
HTML & CSS
.Fbox {
border: 5px solid black;
background-color: #343F50;
}
.innerBox {
box-sizing: border-box;
border-top: 3px solid #4A5568;
border-left: 3px solid #4A5568;
}
<div class="Fbox">
<div class="innerBox">
<p>Helloโ</p>
</div>
</div>
์ถ๊ฐ
div ํ๋๋ง ์จ์ ํด๊ฒฐํ๋ ๋ฒ
์ธ๋ถ์ ๊ฒ์ ํ ๋๋ฆฌ๋ฅผ ๊ทธ๋ฆผ์๋ก ๋ด๋ถ์ ์ผ์ชฝ๊ณผ ์์ ์ ์ border๋ฅผ ํตํด ๊ฐ์ ์ค๋ค.
div {
display: flex;
justify-content: center;
align-items: center;
width: 200px;
height: 100px;
background: #343F50;
box-shadow: 0px 0px 0px 10px rgba(0, 0, 0, 1);
border-top: 10px solid #4A5568;
border-left: 10px solid #4A5568;
}
๋๋ฒ์งธ ๋ฐ์ค
2๋ฒ์งธ ๋ฐ์ค ์ญ์ border dashed๋ฅผ ์ฃผ๋ฉด ํด๊ฒฐ์ด ๋ ๊ฒ ๊ฐ์์ผ๋
๊ฒฐ๊ณผ๋...
๋ฐฑ๊ทธ๋ผ์ด๋ ์ปฌ๋ฌ๊ฐ border์ ๊ฒน์ณ ๋ฒ๋ฆฝ๋๋ค.
์ด ๋ฌธ์ ์ญ์ div๋ฅผ 2๊ฐ ์ฌ์ฉํด์ ๋ง๋ค์๋๋ฐ์ .
HTML & CSS
.borderbox {
margin-top: 50px;
border: 5px dashed #E3D2FC;
border-radius: 100px;
}
.Sbox {
border-radius: 100px;
background: linear-gradient( to right, #823DED, royalblue );
}
<div class="borderbox">
<div class="Sbox">
<p>Helloโ</p>
</div>
</div>
๋ฐ์ ์๋ ๋ฐ์ค ์ฆ, ๋ถ๋ชจ ๋ฐ์ค์๋ค๊ฐ border๋ฅผ ์ค์ ํด๊ฒฐํ์ต๋๋ค. ์์ ๋ณด๋ฉด ๊ฒน์น๋ ์ฝ๋๊ฐ ์์ต๋๋ค. border-radius๋ ์์์ด ๋ถ๊ฐ๋ฅํฉ๋๋ค. ๊ทธ๋ ๊ธฐ์ ์ด์ฉ์ ์์ด 2๋ฒ ๋ฃ์ด ์ฃผ์์ต๋๋ค ๐ซฃ.
์์๋๋ ํ๋กํผํฐ
font-family, font-size, font-weight, line-height, visibility, opacity, color, line-height, text-align, white-space, list-style
์์์ด ๋์ง์๋ ํ๋กํผํฐ
margin, padding, border , box-sizing, display, background, vertical-align, text-ecoration, top/right/bottom/left, position, overflow, width/height
์ถ๊ฐ
background-clip: padding-box ์์ฑ์ ์ฌ์ฉํ๋ฉด div ํ๋๋ง์ ์ฌ์ฉํ์ฌ ํจ๋ฉ์ ๊ณ์น์ง ์๊ฒ ์์น์ํฌ์ ์๋ค.
div {
display: flex;
justify-content: center;
align-items: center;
width: 200px;
height: 100px;
border-radius: 100px;
background: linear-gradient( to right, #823DED, royalblue );
border: 7px dashed #E3D2FC;
background-clip: padding-box;
}
3๋ฒ์งธ ๋ฐ์ค
๋ฐ์ค๋ฅผ ๋ณด๋ฉด 1์ 4์ 7์ ๋ฐฉํฅ์ ๊ผญ์ง์ ๋ค์ด ์ง๊ฐ์ด ์๋ ๋ฅ๊ทธ๋ฐ ๊ณก์ ์ ๋ชจ์์ ๋๊ณ ์๊ณ , ๋๊ฐ์ ์๋๋ก๋ ๊ทธ๋ฆผ์๋ฅผ ๋๊ณ ์์ต๋๋ค.
๋คํํ ์ด ์น๊ตฌ๋ ๊ฐ๋จํ๋ต๋๋ค. border-radius์ ์ฌ์ฉ๋ฒ๊ณผ box-shadow๋ง ์๋ฉด ํด๊ฒฐ ํ์ค์ ์์ต๋๋ค.
.Tbox {
margin-top: 50px;
border: 5px solid #E8E8E8;
border-radius: 0px 100px 100px 100px;
box-shadow: 5px 5px 10px #E8E8E8
}
<div class="Tbox">
<p class="blackFont">Helloโ</p>
</div>
์ฝ๋์ญ์ ๊ฐ๋จํ์ฃ ~
๊ตฌํ ์ด๋ฏธ์ง
๋ ์ข์ ๋ฐฉ๋ฒ์ด ์๋ค๋ฉด ์๋ ค์ฃผ์ธ์!!!
'๋ฉ์์ด ์ฌ์์ฒ๋ผ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
CSS ์ด๊ธฐ ๊ฐ (initial value) (0) | 2023.03.10 |
---|---|
HTML & CSS flex ์ ๋ฆฌ (0) | 2023.03.08 |
HTML & CSS float ์ ๋ฆฌ (0) | 2023.03.08 |
HTML CSS ๊ธฐ์ด(2) ์ ์ฆ์ฐธ (0) | 2023.03.03 |
HTML CSS ๊ธฐ์ด(1) ์ ์ฆ์ฐธ (0) | 2023.03.02 |