Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Oracle LISTAGG 사용 예시
- Angular Router
- summary
- 호버
- 앵귤러 모달
- scroll
- 스크롤 이벤트 감지
- ApexChart
- angular modal
- modal
- 앵귤러 애니메이션
- 아이오닉 스크롤 이벤트
- formgroup
- ajax 사용 예시
- 옵저버블
- 모달
- angular animation
- Ionic modal
- route
- 검색
- mysql if
- egov spring ajax 사용 예시
- TAILWIND
- 셀렉트박스 커스텀
- flex-1
- angular button
- prisma
- 스크롤 이벤트
- angular route
- Router
Archives
- Today
- Total
깜놀하는 해므찌로
Tailwind background image cover 배경 이미지 커버 활용 예시 / VW / VH 본문
반응형
SMALL
<main
class="flex w-full h-screen bg-cover bg-[url('/img/hero-pattern.svg')]
>
</main>
1. 이미지 경로 기본 슬래시 / 사용
2. screen 속성은 vh, vw 수치를 결정한다. 현재 스크린의 max-w : vw="100"
<section class="flex flex-col w-full h-screen relative">
<div
class="w-full h-full absolute bg-cover bg-[url('/assets/background/background_image_beach.svg')] z-0"
></div> 배경이미지
<div class="flex flex-col gap-8 px-40 h-full flex-1 justify-center z-10">
콘텐츠
<div>
</section>
3. z-index 를 활용하여 배경이미지와 콘텐츠를 따로 관리하기도 합니다. (div)
<img
src="assets\background\background_3.png"
class="w-full h-full absolute z-0 object-cover pointer-events-none"
/>
4. img 태그 하나로도 대체할 수 있습니다.
5. object-cover : 해당 속성이 없으면 이미지가 늘어나거나 깨지지 않고 깔끔하게 채워집니다.
6. pointer-events-none : 마우스 드래그를 막습니다. 이미지 태그에 웬만하면 넣는 것을 추천드려요
https://tailwindcss.com/docs/object-fit
참고
반응형
LIST
'IT' 카테고리의 다른 글
Tailwind background-image example (0) | 2023.05.15 |
---|---|
@HostBinding 활용 예시 (0) | 2023.05.15 |
vue.js 배열 핸들링 / vue.js for문 (0) | 2023.05.15 |
vue.js selectbox 셀렉트 박스 예시 / v-for / v-model (0) | 2023.05.14 |
Springboot 스프링 부트 static / templates 폴더 (0) | 2023.05.13 |