• 카테고리

    질문 & 답변
  • 세부 분야

    자격증 (디자인)

  • 해결 여부

    미해결

js작동이 안되는데 머가문제일까요 ㅠㅠ

23.07.21 17:54 작성 조회수 88

1

<!DOCTYPE html>
<html lang="ko">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="css/style.css">
</head>
<body>
    <div class="container">
      <header>
        <div class="header-logo"></div>
        <div class="navi"></div>
      </header>
      <div class="slide">
        <div></div>
      </div>
      <div class="items">
        <div class="news">
          <div class="tab-inner">
            <div class="btn">
              <span class="active">공지사항</span>
              <span>갤러리</span>
            </div>
            <div class="tabs">
              <div class="tab1">tab1</div>
              <div class="tab2">tab2</div>
            </div>
          </div>
        </div>
        <div class="gallery"></div>
        <div class="shortcut"></div>
      </div>
      <footer>
       <div class="footer-logo"></div>
       <div class="copyright"></div>
       <div class="sns"></div>
      </footer>
    </div>
    <script src="script/jquery-1.12.4.js"></script>
    <script src="script/custom.js"></script>
</body>
</html>

@charset "UTF-8";

.container{
   border: 1px solid #000;
   width: 1200px;
   margin: auto;
}
header{
   display: flex;
   justify-content: space-between;
}
header >div{
   border: 1px solid #000;
   height: 100px;
   
   
}
.header-logo{
   width: 200px;
}
.navi{
  width: 600px;
}
.slide{}
.slide >div{
   border: 1px solid #000;
   height: 300px;
}
.items{
   display: flex;
}
.items >div{
   border: 1px solid #333;
   height: 200px;
}
.news{
   width: 500px;
}
.gallery{
   width: 350px;
}
.shortcut{
   width: 350px;
}
footer{
   display: flex;
}
footer >div{
   border: 1px solid #333;
   height: 100px;
}
.footer-logo{
  width: 200px;
}
.copyright{
 width: 800px;
}
.sns{
  width: 200px;
}

/* tab-content */
.tab-inner{
   width: 95%;
   margin: auto;
}
.btn{}
.btn span{
   border: 1px solid #000;
   display: inline-block;
   padding: 10px;
   border-radius: 5px 5px 0 0;
   margin-right: -6px;
   background-color: #ddd;
   width: 100px;
   border-bottom: none;
   margin-bottom: -1px;
   cursor: pointer;

}
.btn span.active{
   background-color: #fff;
}
.tabs{}
.tabs div{
   border: 1px solid #000;
   height: 150px;
}
.tab1{}
.tab2{
   display: none;
}


/*tab content*/
$('.btn span:frist-child').click(function(){
    $('.tab1').show()
    $('.tab2').hide()
})
$('.btn span:last-child').click(function(){
    $('.tab2').show()
    $('.tab1').hide()
})

js가작동이안되는거같아요 ,,, 일단 따라하고있는데 script 소스가 문제인걸까요 ??

답변 1

답변을 작성해보세요.

0

first를 오타 내셨어요.

image