CSS 레이아웃Position미니 프로젝트: 리드잇북스

Q

ad-banner 클래스에 position: fixed를 적용하면 아예 보이지 않습니다.

조회 440

좋아요 0

2024년 1월 2일

A
4개의 답변이 있어요
2024년 1월 2일

댓글 1

베스트 댓글
2024년 1월 2일
아 제가 bottom을 빼서 안 보였던 것이였어요! 근데 display: fixed로 width: 100%를 주면 왜 text-align: center를 해도 오른쪽으로 치우치는지 궁금합니다.
2024년 1월 2일

댓글 2

2024년 1월 2일
body { margin: 0; font-family: 'Noto Sans KR', sans-serif; } a { color: #12172a; text-decoration: none; } a:hover { text-decoration: underline; } .nav { position: sticky; top: 0; z-index: 1; width: 100%; padding: 20px 80px; border-bottom: 1px solid #e1e6f1; background-color: #ffffff; box-shadow: 0px 0px 20px rgba(27, 39, 50, 0.05); } .logo { display: inline; margin-right: 56px; font-weight: 900; font-size: 16px; line-height: 23px; } .logo-accent { color: #ea5493; } .menu { display: inline; margin: 0; padding: 0; } .menu-item { display: inline; margin: 0 12px; color: #717f8e; list-style: none; font-weight: 500; } .menu-item.active { color: #000000; } main { padding: 40px 80px; } .title { margin: 60px 0 8px; color: #12172a; font-weight: 700; font-size: 24px; line-height: 35px; } .hot-badge { position: relative; top: -10px; left: 10px; padding: 2px 4px; border-radius: 4px; background-color: #ea5493; color: #ffffff; font-weight: 500; font-size: 12px; line-height: 17px; } .description { margin: 0; color: #717f8e; font-weight: 400; font-size: 16px; line-height: 23px; } .book { margin: 64px 0; padding: 24px 48px; border-radius: 8px; background: #f4f5f9; box-shadow: 0px 4px 15px rgba(18, 23, 42, 0.03); } .book-container { margin: 0 auto; width: 324px; } .book-thumb { overflow: hidden; margin-top: -56px; width: 128px; height: 200px; border: 2px solid #595d6d; border-radius: 4px; filter: drop-shadow(0px 4px 23px rgba(16, 20, 32, 0.1)); } .book-thumb-image { display: block; width: 100%; height: 100%; } .book-promotion-badge { position: absolute; left: 8px; bottom: 8px; padding: 4px 8px; border-radius: 4px; background-color: #ea5493; color: #ffffff; font-weight: 500; font-size: 12px; line-height: 17px; } .book .title { margin: 24px 0 8px; color: #12172a; font-weight: 700; font-size: 24px; line-height: 35px; } .book-description { font-weight: 400; font-size: 12px; line-height: 17px; margin: 8px 0; } .book-info { margin: 24px 0; padding: 12px; border-radius: 12px; background-color: #2e3846; color: #ffffff; text-align: center; font-weight: 400; font-size: 12px; line-height: 17px; } .book .date { font-weight: 700; } .ad-banner { position: fixed; bottom: 0; width: 100%; padding: 40px; background: rgba(49, 58, 71, 0.9); color: #fff; text-align: center; backdrop-filter: blur(6px); } .ad-banner-title { margin: 0; font-weight: 700; font-size: 24px; line-height: 35px; } .ad-banner-description { margin: 16px 0; color: #cbcbcb; font-weight: 500; } .ad-banner-cta { display: block; margin: 0 auto; padding: 12px; width: 390px; border-radius: 16px; background-color: #ea5493; color: #ffffff; text-align: center; text-decoration: none; }
2024년 1월 2일
아래 답변으로 올렸습니다.
2024년 1월 2일
2024년 2월 22일

(주) 코드잇

대표강영훈

개인정보보호책임자강영훈

이메일support@codeit.kr

사업자 번호313-86-00797

통신판매업제 2019-서울중구-1034 호

주소서울특별시 중구 청계천로 100 시그니쳐타워 동관 10층 코드잇