• 카테고리

    질문 & 답변
  • 세부 분야

    자격증 (디자인)

  • 해결 여부

    미해결

추가영상에서 span을 a태그로변경하라하셔서 했는데 이렇케 뜨는게 맞을까요?

23.07.24 14:52 작성 조회수 131

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">
              <a href="#none"class="active">공지사항</a>
              <a href="#none">갤러리</a>
            </div>
            <div class="tabs">
              <div class="tab1">
                <a href="#none">핸드폰수리일정안내입니다.<b>2022.07.24</b></a>
                <a href="#none">핸드폰 택배일정 안내입니다.<b>2022.07.24</b></a>
                <a href="#none">핸드폰 현금영수증안내입니다.<b>2022.07.24</b></a>
                <a href="#none">핸드폰 주문시안내입니다.<b>2022.07.24</b></a>
                <a href="#none">핸드폰 환불및교환 안내입니다.<b>2022.07.24</b></a>
              </div>
              <div class="tab2">
                <a href="#none"><img src="images/gallery-01.jpg" alt="gallery1"></a>
                <a href="#none"><img src="images/gallery-02.jpg" alt="gallery2"></a>
                <a href="#none"><img src="images/gallery-03.jpg" alt="gallery3"></a>
              </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-inner*/
.tab-inner{
   width: 95%;
   margin: auto;
}
.btn{}
.btn a{
   display: inline-block;
   border: 1px solid #000;
   width: 120px;
   text-align: center;
   border-radius: 5px 5px 0 0;
   padding: 5px;
   margin-right: -6px;
   border-bottom: none;
   margin-bottom: -1px;
   background-color: #ddd;
   cursor: pointer;
}
.btn a.active{
   background-color: #fff;
}
.tabs{}
.tabs div{
   border: 1px solid #000;
   height: 155px;
   padding: 0 10px;
}
.tab1{
   
}
.tab1 a{
   display: block;
   color: #000;
   text-decoration: none;
   border-bottom: 1px solid #333;
   padding: 4px;
  
}
.tab1 a:last-child{
   border-bottom: none;
}
.tab1 a b{
   float: right;
   font-weight: normal;
}
.tab2{
   display: none;
   text-align: center;
}
.tab2 img{
   width: 120px;
   margin-top: 20px;
}

/*tab content*/
$('.btn a:first-child').click(function(){
    $('.tab1').show()
    $('.tab2').hide()
    $(this).addClass('active')
    $(this).siblings().removeClass('active')
})
$('.btn a:last-child').click(function(){
    $('.tab2').show()
    $('.tab1').hide()
    $(this).addClass('active')
    $(this).siblings().removeClass('active')
})

추가영상에서 span을 a태그로변경하라하셔서 했는데 브라우저에 공지사항 갤러리 밑에 밑줄이 표시되는데 이렇케 뜨는게 맞을까요?

답변 1

답변을 작성해보세요.

0

.btn a를 .btn span으로 해도 상관없습니다. 오히려 실무에서는 span으로 하는게 더 낫습니다. 하지만 웹디자인 기능사 실기 시험은 아래 공개도면의 지시사항 때문에 .btn a로 하는 것입니다. 왜냐면 .btn span으로 하면 Tab 키로 이동할 때 이 부분이 선택이 안됩니다. 그래서 1~2점이지만 감점이 될 수 있습니다. 그래서 .btn a로 하는 겁니다.

image

.btn a에 color: #000; text-decoration: none;를 넣어주시면 됩니다. 그런데 이것보다는 body에 color: #000; text-decoration: none; 를 한번 넣어주면 다른 곳에 여러번 넣어줄 필요가 없습니다.