일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- QueryClient
- ignore padding
- CustomHook
- Carousel
- parent padding
- debouncing
- 제어컴포넌트
- twoarrow
- alias설정
- 부모요소의 패딩 무시
- vite
- 화살표2개
- accordian
- 서초구보건소 #무료CPR교육
- 부모패딩
- BlockFormattingContext
- 함수형프로그래밍
- useQueryClient
- tailwindCSS
- 문제해결
- 조건부스타일
- DOM
- transition
- BFC
- ?? #null병합연산자
- es6
- createPortal
- 이즐 #ezl #욕나오는 #교통카드
- react
- 리액트
Archives
- Today
- Total
프론트엔드 첫걸음
float 사용하여 기본 레이아웃 만들기 본문
float 사용하여 기본 레이아웃 만들기
See the Pen float 사용해서 기본 레이아웃 만들기 by JEONG (@cona) on CodePen.
float
요소를 공중에 띄운다고 생각
(left와 content 모두 float:right 이면 left태그가 더 오른쪽에 보여진다)
clear : both
https://developer.mozilla.org/ko/docs/Web/CSS/clear
clear - CSS: Cascading Style Sheets | MDN
clear CSS 속성은 요소가 선행 부동(floating) 요소 다음일 수 있는지 또는 그 아래로 내려가(해제되어(cleared))야 하는 지를 지정합니다. clear 속성은 부동 및 비부동 요소 모두에 적용됩니다.
developer.mozilla.org
clear : right
선행된 float가 right일때 float 효과 해제
clear : left
선행된 float가 left일때 float 효과 해제
clear : both
선행된 float가 left든 right이든 모두 해제
* clear:both 준 박스에 margin-top이 적용 안되는 문제 해결위해 빈 div 박스에 clear:both 주는 해결방법도 있다.
<div class="container">
<div class="header"></div>
<div class="left"></div>
<div class="content"></div>
<div style="clear:both;"></div>
<div class="footer"></div>
</div>
'개발 공부 > CSS' 카테고리의 다른 글
배경이미지 넣기 (0) | 2022.07.04 |
---|---|
inline-block 사용하여 기본 레이아웃 만들기 (0) | 2022.07.04 |
폰트 크기 줄이고 세로 정렬 맞추기 - line-height 또는 inline-flex (0) | 2022.07.02 |
vertical-align (0) | 2022.07.02 |
띄어쓰기 유무에 따라 달라지는 가상클래스 (0) | 2022.07.02 |