• 로그인
  • 장바구니에 상품이 없습니다.

home2 게시판 Next.js 게시판 선생님 nextjs에서 tailwindcss 적용 문제.,.

선생님 nextjs에서 tailwindcss 적용 문제.,.

3 글 보임 - 1 에서 3 까지 (총 3 중에서)
  • 글쓴이
  • #85057

    정중식
    참가자
    이런 구조를 갖고있는데요,
    Main컴포넌트에서 tailwindcss 적용이 잘 안됩니다.
    Main컴포넌트 내용을 원래는 page.js컴포넌트에 넣어놨었는데, 이때는 css적용이 잘됬는데
    컴포넌트 분리를 시키니까 적용이 잘안됩니다. 왜그런걸까요?
    page.js ( index.js라고생각하면됩니다.)
    'use client';
    import Main from '@/component/Main';
    import { getRandomQuote } from '../util/wiseSaying';
    export default function Home() {
      const quote = getRandomQuote();
      return (
        <>
          <Main />
        </>
      );
    }
    
    
    'use client';
    import Image from 'next/image';
    import { motion } from 'framer-motion';
    const Main = () => {
      return (
        <motion.div
          className='flex justify-center items-center absolute inset-0 '
          initial={{ opacity: 0 }}
          animate={{ opacity: 1 }}
          transition={{ duration: 1 }}
        >
          <Image
            src='/calendar.png'
            className='text-9xl'
            alt='캘린더이미지'
            width={120}
            height={120}
          />
          <span className='separator'></span>
          <Image
            src='/notes.png'
            className='text-9xl'
            alt='포스트잇 이미지'
            width={120}
            height={120}
          />
          <span className='separator'></span>
          <Image
            src='/fortuneCookie.png'
            className='text-9xl'
            alt='포츈쿠키이미지'
            width={120}
            height={120}
          />
          <span className='separator'></span>
          <Image
            src='/exercise1.png'
            className='text-9xl'
            alt='운동이미지'
            width={120}
            height={120}
          />
        </motion.div>
      );
    };
    export default Main;
     
    #85065

    codingapple
    키 마스터
    알수없군요 콘솔창 에러메세지같은거 있나 확인해봅시다
    #85220

    정중식
    참가자
    해결완료!
    tailwind.config.js 세팅과 다른 컴포넌트폴더이름명을 사용했어요
    
    tailwind.config.js에는 components/ 이렇게해줫는데
    저는 실제로 component/ 이렇게 사용했네요 ㅋㅋ 
    
    
3 글 보임 - 1 에서 3 까지 (총 3 중에서)
  • 답변은 로그인 후 가능합니다.

About

현재 월 700명 신규수강중입니다.

  (09:00~20:00) 빠른 상담은 카톡 플러스친구 코딩애플 (링크)
  admin@codingapple.com
  이용약관
ⓒ Codingapple, 강의 예제, 영상 복제 금지
top

© Codingapple, All rights reserved. 슈퍼로켓 에듀케이션 / 서울특별시 강동구 고덕로 19길 30 / 사업자등록번호 : 212-26-14752 온라인 교육학원업 / 통신판매업신고번호 : 제 2017-서울강동-0002 호 / 개인정보관리자 : 박종흠