[HTML5&CSS3] Content 상관없이 aside, footer 고정시키기

최대 1 분 소요

<aside>, <footer> 고정 시키기

  • position: fixed
  • aside의 경우 right: 0 로 고정, bottom: ?px 으로 띄우기
  • footer의 경우 bottom: 0 으로 고정

코드

aside {
    position: fixed;
    right: 0; 
    bottom: 500px;
    z-index: 1000;
}

footer {
    background-color: #f1f1f1;
    text-align: center;
    position: fixed;
    width: 100%;
    bottom: 0;
}

Github: https://github.com/KimGyeongLock/resume

문제 상황

998ef591-2eb4-49ba-a86f-031eb38082d9

왜 제 위치로 가지 않는가??

⇒ 제 위치로 간 것이다.

Untitled

  • Contents의 길이가 짧기 때문에 페이지가 짧아진거지 제 위치에 있다.

5185740f-23fe-42c3-bf23-48f5d7069670

  • Content에 상관없이 고정시키려면 어떻게 해야할까??

CSS 를 사용해야 한다!!

Untitled 1

추가 HTML5, CSS3 공부

HTML에 외부 CSS 적용법

<head> 안에 아래 코드를 넣는다.

 <link rel="stylesheet" href="style.css">

Flexbox 또는 Grid로 섹션 위치 크기 조정

.edu-item {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}
.profile {
    flex: 1;
    ...
}
.info {
    flex: 1.3;
    ...
}

공부: https://tlsdnjs12.tistory.com/4

카테고리:

업데이트: