๐Ÿ„

002 content

ย 
main_container ์˜์—ญ์„ ๋งŒ๋“ค๊ณ  main_container ์•ˆ์— inner๋ฅผ, inner ์•ˆ์— contents_box๋ฅผ ๋งŒ๋“ค๊ณ  ์•ˆ์— contents๋“ค์„ ๋ฐฐ์น˜ํ•˜์—ฌ contents ๋ถ€๋ถ„์„ ๋งŒ๋“ค์–ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.
ย 
๊ฐ„๋‹จํ•˜๊ฒŒ ํ‹€์„ ์ž‘์„ฑํ•ด๋ณด๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.
notion imagenotion image
ย 
ํŒŒ์ผ๋ช… : index.html
... <div class="search_box"> <input type="text" placeholder="๊ฒ€์ƒ‰" id="search-field"> <div class="fake_field"> <span class="sprite_small_search_icon"></span> <span>๊ฒ€์ƒ‰</span> </div> </div> <div class="right_icons"> <div class="sprite_camera_icon"></div> <div class="sprite_compass_icon"></div> <div class="sprite_heart_icon_outline"></div> <div class="sprite_user_icon_outline"></div> </div> </section> </header> <section id="main_container"> <div class="inner"> <div class="contents_box"> <article class="contents"> </article> </div> </div> </section> </section> </body> </html>
ย 
margin์„ ์ฃผ๊ฒŒ ๋˜๋ฉด margin ๋ณ‘ํ•ฉ ํ˜„์ƒ์ด ์ผ์–ด๋‚˜๊ฒŒ ๋˜๋ฏ€๋กœ, ์ปจํ…์ธ ๋ฅผ ๋ฐ€ ๋•Œ์—๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ ์œ„์—์„œ ์•„๋ž˜๋กœ ๋ฐ€์–ด์ฃผ๊ณ  ์•„๋ž˜ ์ปจํ…์ธ ๊ฐ€ ์œ„๋กœ ๋ฐ€ ๋•Œ์—๋Š” padding-top์„ ์ด์šฉํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.
ย 
ํŒŒ์ผ๋ช… : css/style.css
... #main_container{ padding-top: 130px; display: flex; /* ์ปจํ…์ธ ๊ฐ€ ๊ฐ€์šด๋ฐ์— ์œ„์น˜ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•จ */ justify-content: center; /* x์ถ• ๊ฐ€์šด๋ฐ ์ •๋ ฌ */ } #main_container .inner{ width: 935px; /* height: 500px; */ /* background: red; */ } .contents_box{ } .contents{ width: 614px; height: 500px; border: 1px solid rgba(0,0,0,0.09); border-radius: 3px; /* ํ…Œ๋‘๋ฆฌ๋ฅผ ๋‘ฅ๊ธ€๊ฒŒ ๋งŒ๋“ฌ */ margin-bottom: 60px; /* ๋‹ค๋ฅธ contents๋“ค์ด ๋ฐ€๋ ค์•ผ ๋˜๊ธฐ ๋•Œ๋ฌธ์— ์‚ฌ์ด์— ์—ฌ๋ฐฑ์„ ์ค€๋‹ค */ background: white; }
ย 
notion imagenotion image
ย 
์ด์ œ contents์˜์—ญ์„ ๋ถ„ํ• ํ•ด ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.
์•„๋ž˜ ์‚ฌ์ง„์„ ๋ณด๋ฉด ์ž‘์„ฑ์ž ์ •๋ณด๊ฐ€ ์žˆ๋Š” ํƒ‘, ์ด๋ฏธ์ง€๋ฅผ ๋ณด์—ฌ์ฃผ๋Š” ์ด๋ฏธ์ง€ ์„น์…˜, ์•„์ด์ฝ˜, like ์˜์—ญ, ๋Œ“๊ธ€ ์ปจํ…Œ์ด๋„ˆ ๊ทธ๋ฆฌ๊ณ  ์‹œ๊ฐ„์„ ๋ณด์—ฌ์ฃผ๋Š” ํƒ€์ด๋จธ ์˜์—ญ๊ณผ, ๋Œ“๊ธ€ ํ•„๋“œ ๋ถ€๋ถ„์œผ๋กœ ์ด๋ฃจ์–ด์ ธ ์žˆ์Šต๋‹ˆ๋‹ค.
notion imagenotion image
ย 
top ์˜์—ญ๋ถ€ํ„ฐ ๋งŒ๋“ค์–ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.
top ์˜์—ญ์„ ์ž์„ธํžˆ ์‚ดํŽด๋ณด๋ฉด, ์ปจํ…์ธ  ์•ˆ์—๋Š” ํ”„๋กœํ•„๊ณผ ๊ธ€์ž๋“ค์ด ๋“ค์–ด์žˆ๋Š” ๋ฐ•์Šค์™€ ๋”๋ณด๊ธฐ ๋ฒ„ํŠผ์ด ์žˆ๋Š” ๋ฐ•์Šค๋ฅผ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
ย 
notion imagenotion image
ย 
ํŒŒ์ผ๋ช… : index.html
... <section id="main_container"> <div class="inner"> <div class="contents_box"> <article class="contents"> <header class="top"> <div class="user_container"> <div class="profile_img"> <img src="imgs/thumb.jpeg" alt="ํ”„๋กœํ•„์ด๋ฏธ์ง€"> </div> <div class="user_name"> <div class="nick_name">KindTiger</div> <div class="country">Seoul, South Korea</div> </div> </div> <div class="sprite_more_icon" data-name="more"></div> </header> </article> </div> </div> </section> ...
ย 
ํŒŒ์ผ๋ช… : css/style.css
... #main_container{ padding-top: 130px; display: flex; /* ์ปจํ…์ธ ๊ฐ€ ๊ฐ€์šด๋ฐ์— ์œ„์น˜ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•จ */ justify-content: center; /* x์ถ• ๊ฐ€์šด๋ฐ ์ •๋ ฌ */ } #main_container .inner{ width: 935px; /* height: 500px; */ /* background: red; */ } .contents_box{ } .contents{ width: 614px; height: 500px; border: 1px solid rgba(0,0,0,0.09); border-radius: 3px; /* ํ…Œ๋‘๋ฆฌ๋ฅผ ๋‘ฅ๊ธ€๊ฒŒ ๋งŒ๋“ฌ */ margin-bottom: 60px; /* ๋‹ค๋ฅธ contents๋“ค์ด ๋ฐ€๋ ค์•ผ ๋˜๊ธฐ ๋•Œ๋ฌธ์— ์‚ฌ์ด์— ์—ฌ๋ฐฑ์„ ์ค€๋‹ค */ background: white; } .contents .top{ display: flex; /* ๊ฐ€๋กœ ๋ฐฐ์น˜ */ justify-content: space-between; /* x์ถ• ์ •๋ ฌ_๊ณต๊ฐ„์„ ์ž๋™์œผ๋กœ ๋ถ„๋ฐฐ */ align-items: center; padding: 10px 20px; /* ์œ„์•„๋ž˜ ์–‘์ชฝ */ } .contents .top .profile_img{ width: 32px; height: 32px; border-radius: 50%; /* ํ…Œ๋‘๋ฆฌ๋ฅผ ๋‘ฅ๊ธ€๊ฒŒ ์„ค์ • 50% -> ์›์˜ ํ˜•ํƒœ */ overflow: hidden; /* ์ž์‹์ด ํฌ๊ธฐ๊ฐ€ ๋„˜์น˜์ง€ ์•Š๋„๋ก ํ•œ๋‹ค */ margin-right: 10px; } .contents .top .profile_img img{ width: 100%; /* 100%๊ฐ€ ์—†์„ ๊ฒฝ์šฐ ์ด๋ฏธ์ง€๊ฐ€ ๋“ค์–ด๊ฐ€์ง€ ์•Š์Œ */ } .contents .top .user_container{ display: flex; /* ๊ฐ€๋กœ ๋ฐฐ์น˜ */ }
ย 
notion imagenotion image
ย 
์œ„ ๊ทธ๋ฆผ๊ณผ ์•„๋ž˜ ๊ทธ๋ฆผ์„ ๋น„๊ตํ•ด ๋ณด๋ฉด ์œ„์น˜์™€ ์•„์ด๋””์˜ ๊ธ€์”จ๊ฐ€ ๊ตฌ๋ถ„์ด ๋˜์–ด ์žˆ๋Š” ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ m_text ํด๋ž˜์Šค์™€ s_text ํด๋ž˜์Šค๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ ์ด๋ฅผ ์ˆ˜์ •ํ•˜๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.
notion imagenotion image
ย 
ํŒŒ์ผ๋ช… : index.html
... <section id="main_container"> <div class="inner"> <div class="contents_box"> <article class="contents"> <header class="top"> <div class="user_container"> <div class="profile_img"> <img src="imgs/thumb.jpeg" alt="ํ”„๋กœํ•„์ด๋ฏธ์ง€"> </div> <div class="user_name"> <div class="nick_name m_text">KindTiger</div> <div class="country s_text">Seoul, South Korea</div> </div> </div> <div class="sprite_more_icon" data-name="more"></div> </header> </article> </div> </div> </section> ...
ย 
ํŒŒ์ผ๋ช… : css/style.css
... .contents .top{ display: flex; /* ๊ฐ€๋กœ ๋ฐฐ์น˜ */ justify-content: space-between; /* x์ถ• ์ •๋ ฌ_๊ณต๊ฐ„์„ ์ž๋™์œผ๋กœ ๋ถ„๋ฐฐ */ align-items: center; padding: 10px 20px; /* ์œ„์•„๋ž˜ ์–‘์ชฝ */ } .contents .top .profile_img{ width: 32px; height: 32px; border-radius: 50%; /* ํ…Œ๋‘๋ฆฌ๋ฅผ ๋‘ฅ๊ธ€๊ฒŒ ์„ค์ • 50% -> ์›์˜ ํ˜•ํƒœ */ overflow: hidden; /* ์ž์‹์ด ํฌ๊ธฐ๊ฐ€ ๋„˜์น˜์ง€ ์•Š๋„๋ก ํ•œ๋‹ค */ margin-right: 10px; } .contents .top .profile_img img{ width: 100%; /* 100%๊ฐ€ ์—†์„ ๊ฒฝ์šฐ ์ด๋ฏธ์ง€๊ฐ€ ๋“ค์–ด๊ฐ€์ง€ ์•Š์Œ */ } .contents .top .user_container{ display: flex; /* ๊ฐ€๋กœ ๋ฐฐ์น˜ */ } .m_text{ font-size: 14px; font-weight: bold; } .s_text{ font-size: 12px; }
ย 
notion imagenotion image
์ด๋ ‡๊ฒŒ ์ค‘๋ณต๋˜๋Š” ๋ถ€๋ถ„๋“ค์ด ๋งŽ์„ ๊ฒฝ์šฐ์—๋Š” ํด๋ž˜์Šค ํ•˜๋‚˜๋กœ ์ •์˜๋ฅผ ํ•ด ๋‘๊ณ  ๋ถˆ๋Ÿฌ์™€์„œ ์“ฐ๋Š” ๋ฐฉ์‹์ด ์กฐ๊ธˆ ๋” ํŽธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
ย 
top์„ ์™„์„ฑํ–ˆ์œผ๋‹ˆ ์ด์ œ img_section ๋ถ€๋ถ„์„ ํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ์ด๋ฏธ์ง€๋“ค์ด ์Šฌ๋ผ์ด๋“œ ๋  ์ˆ˜๋„ ์žˆ๊ธฐ ๋•Œ๋ฌธ์— img_section์— trans_inner๋ฅผ ๋„ฃ๊ณ  ์ด๋ฏธ์ง€๋ฅผ ๋„ฃ๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.
ย 
ํŒŒ์ผ๋ช… : index.html
... <header class="top"> <div class="user_container"> <div class="profile_img"> <img src="imgs/thumb.jpeg" alt="ํ”„๋กœํ•„์ด๋ฏธ์ง€"> </div> <div class="user_name"> <div class="nick_name m_text">KindTiger</div> <div class="country s_text">Seoul, South Korea</div> </div> </div> <div class="sprite_more_icon" data-name="more"></div> </header> <div class="img_section"> <div class="trans_inner"> <div> <img src="imgs/img_section/img01.jpg" alt="visual01"> </div> </div> </div> ...
ย 
ํŒŒ์ผ๋ช… : css/style.css
... .m_text{ font-size: 14px; font-weight: bold; } .s_text{ font-size: 12px; } .contents .img_section{ overflow: hidden; /* ์ž์‹์ด ๋ถ€๋ชจ์˜ ํฌ๊ธฐ๋ฅผ ๋„˜์ง€ ์•Š๋„๋ก ํ•œ๋‹ค */ } .contents .img_section img{ width: 100%; /* ๋ถ€๋ชจ์˜ ํฌ๊ธฐ 100%๋ฅผ ๋ฐ›๋Š”๋‹ค */ }
ย 
notion imagenotion image
ย 
์ด์ฏค๋˜๋ฉด contents ๋ฐ•์Šค ์•ˆ์— ์žˆ๋˜ ๋†’์ด ๊ฐ’์ด ํ•„์š” ์—†๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ๋†’์ด ๊ฐ’์€ contents ๋ฐ•์Šค ์ž์ฒด์—์„œ ๋†’์ด ๊ฐ’์„ ์ฃผ์–ด์„œ ๊ณ ์ •ํ•˜๊ธฐ ๋ณด๋‹ค๋Š” ์ž์‹๋“ค์—๊ฒŒ ๋†’์ด ๊ฐ’์„ ์ฃผ์–ด ์•ˆ์— ์žˆ๋Š” ์š”์†Œ๋“ค๋กœ ๋†’์ด ๊ฐ’์ด ์œ ๋™์ ์œผ๋กœ ๋ณ€ํ•˜๋Š” ๊ฒƒ์ด ๋” ๋ฐ”๋žŒ์งํ•ฉ๋‹ˆ๋‹ค.
ย 
ํŒŒ์ผ๋ช… : css/style.css
... .contents{ width: 614px; /* height: 500px; */ border: 1px solid rgba(0,0,0,0.09); border-radius: 3px; /* ํ…Œ๋‘๋ฆฌ๋ฅผ ๋‘ฅ๊ธ€๊ฒŒ ๋งŒ๋“ฌ */ margin-bottom: 60px; /* ๋‹ค๋ฅธ contents๋“ค์ด ๋ฐ€๋ ค์•ผ ๋˜๊ธฐ ๋•Œ๋ฌธ์— ์‚ฌ์ด์— ์—ฌ๋ฐฑ์„ ์ค€๋‹ค */ background: white; } ...
ย 
์•„์ด์ฝ˜ ๋ฐ•์Šค๋“ค์„ ์ถ”๊ฐ€ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.
notion imagenotion image
ย 
์•„์ด์ฝ˜ ๋ฐ•์Šค์—์„œ๋„ top๊ณผ ๊ฐ™์ด ์™ผ์ชฝ๊ณผ ์˜ค๋ฅธ์ชฝ์œผ๋กœ ๋‚˜๋ˆ„์–ด์ ธ์„œ ๋ฐฐ์น˜๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ์™ผ์ชฝ ์•„์ด์ฝ˜์—๋Š” ํ•˜ํŠธ๊ฐ€ ๋“ค์–ด์˜ฌ ๊ฒƒ์ธ๋ฐ ์—ฌ๊ธฐ์—๋Š” ์• ๋‹ˆ๋ฉ”์ด์…˜์ด ์ ์šฉ๋˜์•ผ ํ•จ์œผ๋กœ ํ•œ ๋ฒˆ ๊ฐ์‹ธ์ฃผ๋Š” ํ˜•ํƒœ๋ฅผ ๋งŒ๋“ค๊ฒ ์Šต๋‹ˆ๋‹ค. ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ๊ฐ€๋กœ ๋ฐฐ์น˜๋ฅผ ์œ„ํ•ด์„œ display: flex; ์™€ justify-content: space-between;๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
ย 
ํŒŒ์ผ๋ช… : index.html
... <div class="img_section"> <div class="trans_inner"> <div> <img src="imgs/img_section/img01.jpg" alt="visual01"> </div> </div> </div> <div class="bottom_icons"> <div class="left_icons"> <div class="heart_btn"> <div class="sprite_heart_icon_outline" name="39" data-name="heartbeat"></div> </div> <div class="sprite_bubble_icon"></div> <div class="sprite_share_icon" data-name="share"></div> </div> <div class="right_icon"> <div class="sprite_bookmark_outline" data-name="bookmark"></div> </div> </div> ...
ย 
ํŒŒ์ผ๋ช… : css/style.css
... .contents .img_section{ overflow: hidden;/* ์ž์‹์ด ๋ถ€๋ชจ์˜ ํฌ๊ธฐ๋ฅผ ๋„˜์ง€ ์•Š๋„๋ก ํ•œ๋‹ค */ } .contents .img_section img{ width: 100%; /* ๋ถ€๋ชจ์˜ ํฌ๊ธฐ 100%๋ฅผ ๋ฐ›๋Š”๋‹ค */ } .contents .bottom_icons{ display: flex; /* ๊ฐ€๋กœ ๋ฐฐ์น˜ */ justify-content: space-between; /* x์ถ• ์ •๋ ฌ_๊ณต๊ฐ„์„ ์ž๋™์œผ๋กœ ๋ถ„๋ฐฐํ•จ */ align-items: center; /* y์ถ• ๊ฐ€์šด๋ฐ ์ •๋ ฌ */ padding: 10px 20px; } .contents .bottom_icons .left_icons{ display: flex; /* ๊ฐ€๋กœ ๋ฐฐ์น˜ */ } .contents .bottom_icons .left_icons > div{ margin-right: 10px; }
ย 
๋‹ค์Œ์œผ๋กœ๋Š” ์ข‹์•„์š” ๋ถ€๋ถ„์„ ๋งŒ๋“ค์–ด ๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.
notion imagenotion image
ย 
ํŒŒ์ผ๋ช… : index.html
... <div class="bottom_icons"> <div class="left_icons"> <div class="heart_btn"> <div class="sprite_heart_icon_outline" name="39" data-name="heartbeat"></div> </div> <div class="sprite_bubble_icon"></div> <div class="sprite_share_icon" data-name="share"></div> </div> <div class="right_icon"> <div class="sprite_bookmark_outline" data-name="bookmark"></div> </div> </div> <div class="likes m_text"> ์ข‹์•„์š” <span id="count">2,346</span> ๊ฐœ </div> ...
ย 
ํŒŒ์ผ๋ช… : css/style.css
... .contents .bottom_icons{ display: flex; /* ๊ฐ€๋กœ ๋ฐฐ์น˜ */ justify-content: space-between; /* x์ถ• ์ •๋ ฌ_๊ณต๊ฐ„์„ ์ž๋™์œผ๋กœ ๋ถ„๋ฐฐํ•จ */ align-items: center; /* y์ถ• ๊ฐ€์šด๋ฐ ์ •๋ ฌ */ padding: 10px 20px; } .contents .bottom_icons .left_icons{ display: flex; /* ๊ฐ€๋กœ ๋ฐฐ์น˜ */ } .contents .bottom_icons .left_icons > div{ margin-right: 10px; } .contents .likes{ padding: 5px 20px; color: #262626; }
ย 
notion imagenotion image
ย 
๋‹ค์Œ์—๋Š” comment_container์™€ ํƒ€์ด๋จธ ๋ถ€๋ถ„์„ ๊ฐ™์ด ํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.
์•„๋งˆ ์ด์ œ ์—ฌ๋Ÿฌ๋ถ„๋“ค๋„ ๋‹ค๋“ค ํŒจํ„ด์„ ํŒŒ์•…ํ•ด์„œ display:flex; ์™€ justify-content: space-between; ์œผ๋กœ ๊ฐ€๋กœ ๋ฐฐ์น˜๋ฅผ ์ถฉ๋ถ„ํžˆ ํ•˜์‹ค ์ˆ˜ ์žˆ์œผ์‹ค ๊ฑฐ๋ผ๋Š” ์ƒ๊ฐ์ด ๋“ญ๋‹ˆ๋‹ค.
notion imagenotion image
ย 
ํŒŒ์ผ๋ช… : index.html
... <div class="likes m_text"> ์ข‹์•„์š” <span id="count">2,346</span> ๊ฐœ </div> <div class="comment_container"> <div class="comment"> <div class="nick_name m_text">dongdong2</div> <div>๊ฐ•์•„์ง€๊ฐ€ ๋„ˆ๋ฌด ๊ท€์—ฌ์›Œ์š”~!</div> </div> <div class="small_heart"> <div class="sprite_small_heart_icon_outline"></div> </div> </div> <div class="timer">1์‹œ๊ฐ„ ์ „</div> ...
ย 
ํŒŒ์ผ๋ช… : css/style.css
... .contents .likes{ padding: 5px 20px; color: #262626; } .contents .comment_container{ display: flex; /* ๊ฐ€๋กœ ๋ฐฐ์น˜ */ justify-content: space-between; align-items: center; padding: 5px 20px; } .contents .comment_container .comment{ display: flex; /* ๊ฐ€๋กœ ๋ฐฐ์น˜ */ font-size: 14px; } .contents .comment_container .comment .nick_name{ margin-right: 10px; /* ์•„์ด๋””์™€ ๋Œ“๊ธ€ ๊ฐ„์˜ ๊ฑฐ๋ฆฌ ์„ค์ • */ } .contents .timer{ font-size: 10px; letter-spacing: 0.2px; /* ์ž๊ฐ„ ์กฐ์ • */ color: #999; border-bottom: 1px solid rgba(0,0,0,0.09); /* ์•„๋ž˜์ชฝ ์‹ค์„  ์ถ”๊ฐ€ */ padding: 10px 20px; }
ย 
notion imagenotion image
ย 
comment_field๋ฅผ ๋งŒ๋“ค์–ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ์ž…๋ ฅ์„ ํ•  ์ˆ˜ ์žˆ๋Š” ๋ถ€๋ถ„์ด๊ธฐ ๋•Œ๋ฌธ์— input ํƒœ๊ทธ๊ฐ€ ๋“ค์–ด๊ฐ€๊ณ  ์—…๋กœ๋“œํ•˜๋Š” ๊ฒŒ์‹œ ๋ฒ„ํŠผ์ด ๋“ค์–ด๊ฐ‘๋‹ˆ๋‹ค.
notion imagenotion image
ย 
ํŒŒ์ผ๋ช… : index.html
... <div class="comment_container"> <div class="comment"> <div class="nick_name m_text">dongdong2</div> <div>๊ฐ•์•„์ง€๊ฐ€ ๋„ˆ๋ฌด ๊ท€์—ฌ์›Œ์š”~!</div> </div> <div class="small_heart"> <div class="sprite_small_heart_icon_outline"></div> </div> </div> <div class="timer">1์‹œ๊ฐ„ ์ „</div> <div class="comment_field"> <input type="text" placeholder="๋Œ“๊ธ€๋‹ฌ๊ธฐ..."> <div class="upload_btn m_text">๊ฒŒ์‹œ</div> </div> ...
ย 
ํŒŒ์ผ๋ช… : css/style.css
... .contents .comment_container{ display: flex; /* ๊ฐ€๋กœ ๋ฐฐ์น˜ */ justify-content: space-between; align-items: center; padding: 5px 20px; } .contents .comment_container .comment{ display: flex; /* ๊ฐ€๋กœ ๋ฐฐ์น˜ */ font-size: 14px; } .contents .comment_container .comment .nick_name{ margin-right: 10px; /* ์•„์ด๋””์™€ ๋Œ“๊ธ€ ๊ฐ„์˜ ๊ฑฐ๋ฆฌ ์„ค์ • */ } .contents .timer{ font-size: 10px; letter-spacing: 0.2px; /* ์ž๊ฐ„ ์กฐ์ • */ color: #999; border-bottom: 1px solid rgba(0,0,0,0.09); /* ์•„๋ž˜์ชฝ ์‹ค์„  ์ถ”๊ฐ€ */ padding: 10px 20px; } .contents .comment_field{ min-height: 56px; padding: 0 20px; position: relative; /* ์ž์‹๋“ค์ด absolute๋กœ ์ž๋ฆฌ๋ฅผ ์žก๊ธฐ ์œ„ํ•จ */ } .contents .comment_field input{ width: 100%; height: 56px; border: none; outline: none; background: transparent; /* ํˆฌ๋ช…ํ•˜๊ฒŒ ์„ค์ • */ } .contents .comment_field input:focus ~ .upload_btn{ pointer-events: initial; /* ํฌ์ธํ„ฐ ์ด๋ฒคํŠธ ์ดˆ๊ธฐํ™” */ opacity: 1; } .contents .comment_field .upload_btn{ color: #3897f0; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); /* y์ถ•์œผ๋กœ ์ค‘์•™ ์ •๋ ฌ */ cursor: pointer; pointer-events: none; /* ์ฒ˜์Œ์—๋Š” ํด๋ฆญ์ด ๋˜์ง€ ์•Š๋„๋ก ํ•œ๋‹ค */ opacity: 0.6; }
ย 
notion imagenotion image
ย 
๋งˆ์ง€๋ง‰์œผ๋กœ ๋ฒ„ํŠผ์„ ์„ ํƒํ•  ์ˆ˜ ์žˆ๋„๋ก cursor๋ฅผ ํฌ์ธํ„ฐ๋กœ ์ฃผ๊ฒ ์Šต๋‹ˆ๋‹ค.
ย 
ํŒŒ์ผ๋ช… : css/style.css
... .contents .bottom_icons .left_icons > div{ margin-right: 10px; cursor: pointer; /* ๋ˆ„๋ฅผ ์ˆ˜ ์žˆ๋„๋ก ํ•˜๊ธฐ ์œ„ํ•จ */ } .contents .bottom_icons .right_icon > div{ cursor: pointer; /* ๋ˆ„๋ฅผ ์ˆ˜ ์žˆ๋„๋ก ํ•˜๊ธฐ ์œ„ํ•จ */ } ...
ย 
์ด๋ ‡๊ฒŒ ํ•ด์„œ contents๋ฅผ ํฌ๊ฒŒ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค. ๋งŽ์ด ๋ณต์‚ฌ๊ฐ€ ๋˜๋ฉด ๋ณต์‚ฌ๊ฐ€ ๋˜๋Š” ๋Œ€๋กœ ํƒ€์ž„๋ผ์ธ์ฒ˜๋Ÿผ ๋‚˜์˜ค๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ์ด์ œ ์ด๊ฒƒ์„ back-end์—์„œ ๋ฐ์ดํ„ฐ๋กœ ํ•˜๋‚˜์”ฉ ๋ถˆ๋Ÿฌ์˜ค๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.
ย 
์™„์„ฑ๋œ ์ฝ”๋“œ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.
ย 
ํŒŒ์ผ๋ช… : index.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="css/reset.css"> <link rel="stylesheet" href="css/style.css"> <script src="js/main.js"></script> </head> <body> <section id="container"> <header id="header"> <section class="inner"> <h1 class="logo"> <a herf="index.html"> <div class="sprite_insta_icon"></div> <div class="sprite_write_logo"></div> </a> </h1> <div class="search_box"> <input type="text" placeholder="๊ฒ€์ƒ‰" id="search-field"> <div class="fake_field"> <span class="sprite_small_search_icon"></span> <span>๊ฒ€์ƒ‰</span> </div> </div> <div class="right_icons"> <div class="sprite_camera_icon"></div> <div class="sprite_compass_icon"></div> <div class="sprite_heart_icon_outline"></div> <div class="sprite_user_icon_outline"></div> </div> </section> </header> <section id="main_container"> <div class="inner"> <div class="contents_box"> <article class="contents"> <header class="top"> <div class="user_container"> <div class="profile_img"> <img src="imgs/thumb.jpeg" alt="ํ”„๋กœํ•„์ด๋ฏธ์ง€"> </div> <div class="user_name"> <div class="nick_name m_text">KindTiger</div> <div class="country s_text">Seoul, South Korea</div> </div> </div> <div class="sprite_more_icon" data-name="more"></div> </header> <div class="img_section"> <div class="trans_inner"> <div> <img src="imgs/img_section/img01.jpg" alt="visual01"> </div> </div> </div> <div class="bottom_icons"> <div class="left_icons"> <div class="heart_btn"> <div class="sprite_heart_icon_outline" name="39" data-name="heartbeat"></div> </div> <div class="sprite_bubble_icon"></div> <div class="sprite_share_icon" data-name="share"></div> </div> <div class="right_icon"> <div class="sprite_bookmark_outline" data-name="bookmark"></div> </div> </div> <div class="likes m_text"> ์ข‹์•„์š” <span id="count">2,346</span> ๊ฐœ </div> <div class="comment_container"> <div class="comment"> <div class="nick_name m_text">dongdong2</div> <div>๊ฐ•์•„์ง€๊ฐ€ ๋„ˆ๋ฌด ๊ท€์—ฌ์›Œ์š”~!</div> </div> <div class="small_heart"> <div class="sprite_small_heart_icon_outline"></div> </div> </div> <div class="timer">1์‹œ๊ฐ„ ์ „</div> <div class="comment_field"> <input type="text" placeholder="๋Œ“๊ธ€๋‹ฌ๊ธฐ..."> <div class="upload_btn m_text">๊ฒŒ์‹œ</div> </div> </article> </div> </div> </section> </section> </body> </html>
ย 
ํŒŒ์ผ๋ช… : css/style.css
.sprite_insta_icon{ display: inline-block; background: url('../imgs/background01.png') no-repeat -53px -235px; width: 22px; height: 22px; } .sprite_write_logo{ display: inline-block; background: url('../imgs/background01.png') no-repeat -94px -72px; width: 103px; height: 29px; } .sprite_compass_icon{ display: inline-block; background: url('../imgs/background01.png') no-repeat -130px -286px; width: 23px; height: 23px; } .sprite_user_icon_outline{ display: inline-block; background: url('../imgs/background01.png') no-repeat -272px -182px; width: 22px; height: 24px; } .sprite_heart_icon_outline{ display: inline-block; background: url('../imgs/background01.png') no-repeat -52px -261px; width: 24px; height: 22px; } .sprite_small_search_icon{ display: inline-block; background: url('../imgs/background01.png') no-repeat -337px -246px; width: 10px; height: 10px; } .sprite_more_icon{ display: inline-block; background: url('../imgs/background01.png') no-repeat -301px -218px; width: 15px; height: 3px; } .sprite_bubble_icon{ display: inline-block; background: url('../imgs/background01.png') no-repeat -239px -202px; width: 24px; height: 24px; } .sprite_share_icon{ display: inline-block; background: url('../imgs/background01.png') no-repeat -324px -52px; width: 21px; height: 24px; } .sprite_bookmark_outline{ display: inline-block; background: url('../imgs/background01.png') no-repeat -237px -286px; width: 19px; height: 24px; } .sprite_bookmark_outline.on{ background: url('../imgs/background01.png') no-repeat -159px -286px; width: 19px; height: 24px; } .sprite_small_heart_icon_outline{ display: inline-block; background: url('../imgs/background01.png') no-repeat -323px -274px; width: 12px; height: 11px; } .sprite_camera_icon{ display: inline-block; background: url('../imgs/background01.png') no-repeat -271px -104px; width: 24px; height: 22px; } .sprite_insta_big_logo{ display: inline-block; background: url('../imgs/background02.png') no-repeat -98px -150px; width: 175px; height: 51px; } .sprite_plus_icon{ display: inline-block; background: url('../imgs/background01.png') no-repeat -187px -202px; width: 23px; height: 23px; } body{ background: #fafafa; } #header{ width: 100%; /* ๊ณต์ค‘์— ๋œจ๊ธฐ ์œ„ํ•จ */ position: absolute; /* ๊ฐ€์žฅ ์œ„์— ์˜ฌ๋ผ๊ฐ€ ์žˆ์–ด์•ผ ํ•˜๊ธฐ ์œ„ํ•จ */ z-index: 999; /* absolute์˜ ๊ฒฝ์šฐ ์ตœ์†Œ x์ถ•์—์„œ 1๊ฐœ y์ถ•์—์„œ 1๊ฐœ์˜ ๊ฐ’์„ ์ฃผ์–ด์•ผ ํ•จ */ left: 0; top: 0; background: white; border-bottom: 1px solid rgba(0,0,0,0.1); } #header .inner{ /* inner ์•ˆ์— ์ปจํ…์ธ ๋ฅผ ๋„ฃ์œผ๋ฉด ์•ˆ์— ๊ฐ’์ด ๋“ค์–ด์˜ด */ width: 975px; height: 77px; margin: 0 auto; /* ๊ฐ€์šด๋ฐ ์ •๋ ฌ */ display: flex; /* ๊ฐ€๋กœ ๋ฐฐ์น˜ */ justify-content: space-between; /* x์ถ• ์ •๋ ฌ_๊ณต๊ฐ„์„ ์ž๋™์œผ๋กœ ๋ถ„๋ฐฐํ•จ */ align-items: center; /* y์ถ• ์ •๋ ฌ */ } #header .inner .logo > a{ color: transparent; /* ๋ฐฐ๊ฒฝ์ƒ‰์„ ํˆฌ๋ช…ํ•˜๊ฒŒ ๋งŒ๋“ฌ */ } #header .inner .logo div{ vertical-align: middle; } #header .inner .logo .sprite_insta_icon{ position: relative; /* after์—๊ฒŒ ์œ„์น˜ ๊ธฐ์ค€์„ ์ „๋‹ฌํ•ด์ฃผ๊ธฐ ์œ„ํ•จ */ margin-right: 30px; } #header .inner .logo .sprite_insta_icon:after{ content: ''; /* ๊ณต๋ฐฑ์„ ๋ฐ›์•„์˜ด */ width: 1px; height: 28px; background: #000; position: absolute; /* ๋ถ€๋ชจ๋ฅผ ๊ธฐ์ค€์œผ๋กœ ์œ„์น˜๋ฅผ ์žก์Œ */ right: -15px; top: -4px; } #header .search_box{ position: relative; /* ๊ธฐ์ค€์ ์„ ์žก๊ณ  ๊ฐ€๋กœ ๋ฐฐ์น˜ */ } #search-field{ width: 185px; height: 28px; background: #fafafa; border: 1px solid #dbdbdb; border-radius: 3px; padding: 3px 30px; /* ์œ„์•„๋ž˜ ์–‘์ชฝ */ color: #999; font-weight: 400; text-align: left; /* ๊ธ€์ž ์ž…๋ ฅ ์‹œ ์™ผ์ชฝ๋ถ€ํ„ฐ ๋ณด์ด๋„๋ก ํ•˜๊ธฐ ์œ„ํ•จ */ font-size: 14px; outline: none; /* ํฌ์ปค์Šค ํ–ˆ์„ ๋•Œ ๋‚˜ํƒ€๋‚˜๋Š” ํŒŒ๋ž€์„  */ } #search-field::placeholder{ /* ์ฝœ๋ก 2๊ฐœ(::) - ์†์„ฑ์„ ํƒ์ž */ font-size: 0; /* ํฌ์ปค์Šค๊ฐ€ ๋˜์ง€ ์•Š์„ ๋•Œ ๊ฒ€์ƒ‰ ๊ธ€์ž๊ฐ€ ๋ณด์ด์ง€ ์•Š๋„๋ก ํ•˜๊ธฐ ์œ„ํ•จ */ } #search-field:focus::placeholder{ font-size: 14px; /* ํฌ์ปค์Šค ๋˜์—ˆ์„ ๋•Œ ๊ฒ€์ƒ‰ ๊ธ€์ž๊ฐ€ ๋ณด์ด๋„๋ก ํ•œ๋‹ค */ } #header .search_box .fake_field{ position: absolute; /* ๊ฒ€์ƒ‰ ์ฐฝ ์œ„์— ๊ธ€์ž๋ฅผ ๋ณด์ด๊ธฐ ์œ„ํ•จ */ /* ๊ฐ€์šด๋ฐ ๋ฐฐ์น˜ํ•˜๋Š” ๊ณต์‹ */ left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; /* ๊ฒ€์ƒ‰์„ ๋ˆŒ๋ €์„ ๋•Œ์—๋Š” ํฌ์ธํ„ฐ ์ธ์‹์ด ์•ˆ ๋จ */ } /* ๋ฌผ๊ฒฐ(~) - ๊ทผ์ฒ˜์— ์žˆ๋Š” fake_field */ #search-field:focus~.fake_field > span:nth-child(1){ transform: translateX(-105px); /* ๋‹๋ณด๊ธฐ๋ฅผ ์™ผ์ชฝ์œผ๋กœ ์ด๋™ */ } #search-field:focus~.fake_field > span:nth-child(2){ display: none; /* ํฌ์ปค์Šค ๋˜์—ˆ์„ ๋•Œ ๊ธ€์ž ์ˆจ๊ธฐ๊ธฐ */ } #header .right_icons{ width: 132px; /* ๋ถ€๋ชจ๊ฐ’ ์ขŒ์šฐ๊ฐ’ ๊ณ ์ • */ display: flex; justify-content: space-between; /* x์ถ• ์ •๋ ฌ_๊ณต๊ฐ„์„ ์ž๋™์œผ๋กœ ๋ถ„๋ฐฐํ•จ */ } #header .inner .logo div:nth-child(2){ transform: translateY(2px); } #header .inner .logo .sprite_insta_icon{ position: relative; /* after์—๊ฒŒ ์œ„์น˜ ๊ธฐ์ค€์„ ์ „๋‹ฌํ•ด์ฃผ๊ธฐ ์œ„ํ•จ */ margin-right: 30px; } #main_container{ padding-top: 130px; display: flex; /* ์ปจํ…์ธ ๊ฐ€ ๊ฐ€์šด๋ฐ์— ์œ„์น˜ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•จ */ justify-content: center; /* x์ถ• ๊ฐ€์šด๋ฐ ์ •๋ ฌ */ } #main_container .inner{ width: 935px; /* height: 500px; */ /* background: red; */ } .contents_box{ } .contents{ width: 614px; /* height: 500px; */ border: 1px solid rgba(0,0,0,0.09); border-radius: 3px; /* ํ…Œ๋‘๋ฆฌ๋ฅผ ๋‘ฅ๊ธ€๊ฒŒ ๋งŒ๋“ฌ */ margin-bottom: 60px; /* ๋‹ค๋ฅธ contents๋“ค์ด ๋ฐ€๋ ค์•ผ ๋˜๊ธฐ ๋•Œ๋ฌธ์— ์‚ฌ์ด์— ์—ฌ๋ฐฑ์„ ์ค€๋‹ค */ background: white; } .contents .top{ display: flex; /* ๊ฐ€๋กœ ๋ฐฐ์น˜ */ justify-content: space-between; /* x์ถ• ์ •๋ ฌ_๊ณต๊ฐ„์„ ์ž๋™์œผ๋กœ ๋ถ„๋ฐฐ */ align-items: center; padding: 10px 20px; /* ์œ„์•„๋ž˜ ์–‘์ชฝ */ } .contents .top .profile_img{ width: 32px; height: 32px; border-radius: 50%; /* ํ…Œ๋‘๋ฆฌ๋ฅผ ๋‘ฅ๊ธ€๊ฒŒ ์„ค์ • 50% -> ์›์˜ ํ˜•ํƒœ */ overflow: hidden; /* ์ž์‹์ด ํฌ๊ธฐ๊ฐ€ ๋„˜์น˜์ง€ ์•Š๋„๋ก ํ•œ๋‹ค */ margin-right: 10px; } .contents .top .profile_img img{ width: 100%; /* 100%๊ฐ€ ์—†์„ ๊ฒฝ์šฐ ์ด๋ฏธ์ง€๊ฐ€ ๋“ค์–ด๊ฐ€์ง€ ์•Š์Œ */ } .contents .top .user_container{ display: flex; /* ๊ฐ€๋กœ ๋ฐฐ์น˜ */ } .m_text{ font-size: 14px; font-weight: bold; } .s_text{ font-size: 12px; } .contents .img_section{ overflow: hidden; /* ์ž์‹์ด ๋ถ€๋ชจ์˜ ํฌ๊ธฐ๋ฅผ ๋„˜์ง€ ์•Š๋„๋ก ํ•œ๋‹ค */ } .contents .img_section img{ width: 100%; /* ๋ถ€๋ชจ์˜ ํฌ๊ธฐ 100%๋ฅผ ๋ฐ›๋Š”๋‹ค */ } .contents .bottom_icons{ display: flex; /* ๊ฐ€๋กœ ๋ฐฐ์น˜ */ justify-content: space-between; /* x์ถ• ์ •๋ ฌ_๊ณต๊ฐ„์„ ์ž๋™์œผ๋กœ ๋ถ„๋ฐฐํ•จ */ align-items: center; /* y์ถ• ๊ฐ€์šด๋ฐ ์ •๋ ฌ */ padding: 10px 20px; } .contents .bottom_icons .left_icons{ display: flex; /* ๊ฐ€๋กœ ๋ฐฐ์น˜ */ } .contents .bottom_icons .left_icons > div{ margin-right: 10px; } .contents .likes{ padding: 5px 20px; color: #262626; } .contents .comment_container{ display: flex; /* ๊ฐ€๋กœ ๋ฐฐ์น˜ */ justify-content: space-between; align-items: center; padding: 5px 20px; } .contents .comment_container .comment{ display: flex; /* ๊ฐ€๋กœ ๋ฐฐ์น˜ */ font-size: 14px; } .contents .comment_container .comment .nick_name{ margin-right: 10px; /* ์•„์ด๋””์™€ ๋Œ“๊ธ€ ๊ฐ„์˜ ๊ฑฐ๋ฆฌ ์„ค์ • */ } .contents .timer{ font-size: 10px; letter-spacing: 0.2px; /* ์ž๊ฐ„ ์กฐ์ • */ color: #999; border-bottom: 1px solid rgba(0,0,0,0.09); /* ์•„๋ž˜์ชฝ ์‹ค์„  ์ถ”๊ฐ€ */ padding: 10px 20px; } .contents .comment_field{ min-height: 56px; padding: 0 20px; position: relative; /* ์ž์‹๋“ค์ด absolute๋กœ ์ž๋ฆฌ๋ฅผ ์žก๊ธฐ ์œ„ํ•จ */ } .contents .comment_field input{ width: 100%; height: 56px; border: none; outline: none; background: transparent; /* ํˆฌ๋ช…ํ•˜๊ฒŒ ์„ค์ • */ } .contents .comment_field input:focus ~ .upload_btn{ pointer-events: initial; /* ํฌ์ธํ„ฐ ์ด๋ฒคํŠธ ์ดˆ๊ธฐํ™” */ opacity: 1; } .contents .comment_field .upload_btn{ color: #3897f0; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); /* y์ถ•์œผ๋กœ ์ค‘์•™ ์ •๋ ฌ */ cursor: pointer; pointer-events: none; /* ์ฒ˜์Œ์—๋Š” ํด๋ฆญ์ด ๋˜์ง€ ์•Š๋„๋ก ํ•œ๋‹ค */ opacity: 0.6; } .contents .bottom_icons .right_icon > div{ cursor: pointer; /* ๋ˆ„๋ฅผ ์ˆ˜ ์žˆ๋„๋ก ํ•˜๊ธฐ ์œ„ํ•จ */ }
ย