질문과 답변

기 타 티스토리 블로그에 웹폰트로 몇가지 기능을 구현하려 합니다

2017.03.15 20:05

TetraTheta 조회:253

지금까지 제 블로그에선 다음과 같은 기능을 png 파일로 해결해 왔습니다.

 - '더보기'옆의 + 아이콘

moreless.PNG

 - 우측 하단의 맨 아래/위 바로가기 링크

scroll.PNG

 - 외부 링크에만 우측에 아이콘 삽입

external.PNG

 

그런데 웹폰트라는 걸 알게 되었습니다. 이게 png 방식보다 여러모로 우월하더군요... 그래서 fontello에 가서 원하는 아이콘만 따로 빼와서 폰트까지 만들어 놨습니다. fontello-b8bfa7fa.zip

그런데 정작 이걸 받아놓고서 어떻게 적용하는지 모르겠는겁니다. 가능하면 기존에 보이던 모습 그대로 하고 싶은데... 어떻게 할지 모르겠습니다.

 

일단 HTML/CSS 쪽은 각각 이렇습니다.

 

① '더보기'옆의 +아이콘

-------- CSS --------

/* 본문 - more / less 더보기 */
.moreless_fold
{ background:url("images/more1.png") no-repeat 0 50%; padding-left:20px; color:#2196F3; font-weight:bold; text-align:left; background-size:17px 17px;}
.moreless_top
{ background:url("images/less1.png") no-repeat 0 50%; padding-left:20px; color:#2196F3; font-weight:bold; text-align:left; background-size:17px 17px;}
.moreless_body
{ }
.moreless_bottom
{ background:url("images/less1.png") no-repeat right 50%; padding-right:20px; color:#2196F3; font-weight:bold; text-align:right; background-size:17px 17px;}
.moreless_fold span{color:#2196F3;font-weight:bold;}
.moreless_top span{color:#2196F3;font-weight:bold;}
.moreless_bottom span{color:#2196F3;font-weight:bold;}

② 우측 하단의 맨 아래/위 바로가기 링크

-------- HTML --------

    <!-- TOP 버튼 추가 -->
    <a href="#" class="jcm-top">
      <img src="./images/top.png" style="margin-bottom: 60px;width:50px;">
    </a>
    <!-- 아이콘 자체 크기 조절 -->
    <a href="#dkFoot" class="jcm-bottom">
      <img src="./images/bottom.png" style="margin-bottom: 60px;width:50px;">
    </a>
    <!-- 아이콘 자체 크기 조절 -->
    <script>
      $( document ).ready( function() {
        $( window ).scroll( function() {
          if ( $( this ).scrollTop() > 300 ) {
            /* 버튼 출현위치 결정 */
            $( '.jcm-top' ).fadeIn();
          }
          else {
            $( '.jcm-top' ).fadeOut();
          }
        }
                          );
        $( '.jcm-top' ).click( function() {
          $( 'html, body' ).animate( {
            scrollTop : 0 }
                                    , 200 );
          /* 숫자 작을수록 빠름 */
          return false;
        }
                             );
      }
                         );
    </script>
    <script>
      $( document ).ready( function() {
        $( window ).scroll( function() {
          if ( $( this ).scrollTop() > 300 ) {
            /* 버튼 출현위치 결정 */
            $( '.jcm-bottom' ).fadeIn();
          }
          else {
            $( '.jcm-bottom' ).fadeOut();
          }
        }
                          );
        $( '.jcm-bottom' ).click( function() {
          $( 'html, body' ).animate( {
            scrollTop : $(document).height() }
                                    , 200 );
          /* 숫자 작을수록 빠름 */
          return false;
        }
                                );
      }
                         );
    </script>

-------- CSS --------

/* TOP 버튼 */
a.jcm-top {
    position: fixed;
    right: 15px;
    bottom: 15px;
    border-radius: 5px;
    color: #ffffff;
      text-align: center;
      width: 50px; /* 여기서 크기 조절 */
      height: 50px;
      font-size: 40px;
    background-color: rgba(0,0,0,0.3);
    z-index: 99999;
        display: none;}
a.jcm-top:hover{background-color:#000}
a.jcm-bottom {
    position: fixed;
    right: 65px;
    bottom: 15px;
    border-radius: 5px;
    color: #ffffff;
      text-align: center;
      width: 50px; /* 여기서 크기 조절 */
      height: 50px;
      font-size: 40px;
    background-color: rgba(0,0,0,0.3);
    z-index: 99999;
        display: none;}
a.jcm-bottom:hover{background-color:#000}

③ 외부 링크에만 우측에 아이콘 삽입

-------- CSS --------

/* Start of Adding icon to external link */
.area_view a[href ^="https://"] {
 background: url(./images/external.png) center left no-repeat;
 padding-left: 20px;
}
.area_view a[href ^="https://"] {
 background: url(./images/external.png) center left no-repeat;
 padding-left: 20px;
}
.area_view a[href^="https://tetralog.tistory.com"] {
 background: none;
 padding-left: 0;
}
.area_view a[href^="https://tetralog.tistory.com"] {
 background: none;
 padding-left: 0;
}
/* End of Adding icon to external link */

 

 

 

이걸 어떻게 해야 웹폰트로 바꿀 수 있을까요? 으으, 이거 너무 어렵습니다...

번호 제목 글쓴이 조회 등록일
[공지] 질문과 답변 게시판 이용간 유의사항 gooddew - -
19686 하드웨어| usb 복구 프로그램 중에 괜찮은거 뭐 있을까요? [6] ┓┓┣ 496 12-07
19685 소프트웨어| 서버2019 에 포토샵 2022 설치 [1] 오리부인 496 10-28
19684 윈 도 우| 윈도우11 작업 표시줄에서 [2] 모퉁이 496 10-09
19683 윈 도 우| 해당 배경화면 차이가 무엇인가요? [1] 명랑젓고난 496 11-01
19682 윈 도 우| 윈도우11에서 글씨가 사라집니다 [3] 9900k 496 07-26
19681 윈 도 우| 꼬져님께 급한 질문 올립니다. [3] 맹물 496 02-22
19680 윈 도 우| 여러 wim파일 듀얼부팅용 PE제작하려는데 뼈대파일좀 부탁... [5] 타시 496 01-20
19679 소프트웨어| Free Download Manager로 자료실의 파일을 다운 받는게 안... [8] brucex 496 01-10
19678 기 타| ali express에서 노트북 구매시 [10] 감사한 496 11-09
19677 윈 도 우| DISM++ 사용해서 appx 앱 삭제할 때에 오류글귀가 뜨네요. [2] SUbSigNal 496 09-07
19676 윈 도 우| sysn****님의 윈도우 설치후 질문좀 드릴께요 [6] 고광렬 496 08-04
19675 윈 도 우| 윈10 20H2 코타나 쓰는 분들 있으려나요?? RoyalS 496 04-21
19674 기 타| 크롬을 기본 브라우저로 사용 하고싶습니다. [4] 이로리 496 03-17
19673 소프트웨어| 하드,usb 암호거는방법? [3] 매일이새롭 496 01-09
19672 윈 도 우| 고급 부팅 옵션 문제 [5] 오두막과시 496 01-10
19671 소프트웨어| Adobe Photoshop 2020 / Win7 설치 [5] 꼬망쥐 496 11-14
19670 윈 도 우| 첨*다님 Win10XPE6.1 내 PC 번호 오류 [5] damoa 496 04-25
19669 기 타| 통신사에서 클라우드 다운로드, 업로드만 속도제한 할수도 ... [3] 우성이 496 04-09
19668 윈 도 우| 윈도우11 업데이트 후 폴더 진입 딜레이? [3] 맑음z 496 08-09
19667 소프트웨어| 토렌트에서 분명 100% 받은걸 확인했는데 삭제후 다시 추가... [2] regor 496 12-21
XE1.11.6 Layout1.4.8