자동 목차에 제목4(h4) 추가

2024. 7. 10. 15:56·코드 정리/코드 정리 - Tistory
목차
  1. HTML
  2. 위를 아래와 같게 수정
  3. CSS
  4. 위를 아래와 같게 수정
  5. 이것을 추가

HTML

위를 아래와 같게 수정


    
html
// 목차 생성
$(document).ready(function() {
$("#toc").toc({content: ".tt_article_useless_p_margin", headings: "h2,h3"});
});

    
html
// 목차 생성
$(document).ready(function() {
$("#toc").toc({content: ".tt_article_useless_p_margin", headings: "h2,h3,h4,h5"});
});

 

 


    
html
{ "pl-0": heading.tagName === "H2", "pl-4": heading.tagName === "H3" }

 


    
html
{ "pl-0": heading.tagName === "H2", "pl-4": heading.tagName === "H3", "pl-8": heading.tagName === "H4" }

 

CSS

위를 아래와 같게 수정


    
css
#shortcutLayer h2,
#shortcutLayer h3{
font-weight: 700
}

    
css
#shortcutLayer h2,
#shortcutLayer h3,
#shortcutLayer h4 {
font-weight: 700
}

 

 


    
css
.dark #shortcutLayer h2,
.dark #shortcutLayer h3,
.dark #shortcutLayer th,
.dark #shortcutLayer td,
.dark #shortcutLayer p {
--tw-border-opacity: 1;
border-color: rgb(53 54 56 / var(--tw-border-opacity));
--tw-text-opacity: 1;
color: rgb(244 244 246 / var(--tw-text-opacity))
}

 


    
css
.dark #shortcutLayer h2,
.dark #shortcutLayer h3,
.dark #shortcutLayer h4,
.dark #shortcutLayer th,
.dark #shortcutLayer td,
.dark #shortcutLayer p {
--tw-border-opacity: 1;
border-color: rgb(53 54 56 / var(--tw-border-opacity));
--tw-text-opacity: 1;
color: rgb(244 244 246 / var(--tw-text-opacity))
}

 

 


    
css
#article .contents_style h2,
#article .contents_style h3 {
margin-top: 1.25rem;
margin-bottom: 1.25rem;
scroll-margin-top: 5rem;
font-weight: 500
}
#article .contents_style h2 a,
#article .contents_style h3 a {
--tw-text-opacity: 1;
color: rgb(53 54 56 / var(--tw-text-opacity))
}
.dark #article .contents_style h2 a,
.dark #article .contents_style h3 a {
--tw-text-opacity: 1;
color: rgb(244 244 246 / var(--tw-text-opacity))
}

 


    
css
#article .contents_style h2,
#article .contents_style h3,
#article .contents_style h4 {
margin-top: 1.25rem;
margin-bottom: 1.25rem;
scroll-margin-top: 5rem;
font-weight: 500
}
#article .contents_style h2 a,
#article .contents_style h3 a,
#article .contents_style h4 a {
--tw-text-opacity: 1;
color: rgb(53 54 56 / var(--tw-text-opacity))
}
.dark #article .contents_style h2 a,
.dark #article .contents_style h3 a,
.dark #article .contents_style h4 a {
--tw-text-opacity: 1;
color: rgb(244 244 246 / var(--tw-text-opacity))
}

 

이것을 추가


    
css
#article .contents_style h4 {
font-size: 1rem;
line-height: 1.5rem
}
@media (min-width: 1100px) {
#article .contents_style h4 {
font-size: 1.125rem;
line-height: 1.75rem
}
}

 

'코드 정리 > 코드 정리 - Tistory' 카테고리의 다른 글

대표 이미지 한번에 수정 / 고정하기  (0) 2025.04.18
날짜 형식  (0) 2024.07.11
마우스 모양 변경 및 클릭시 파동 효과  (0) 2024.07.10
관리 사이드바  (0) 2024.07.05
코드 블럭 수정(mac 형태) + 복사  (0) 2024.07.05
  1. HTML
  2. 위를 아래와 같게 수정
  3. CSS
  4. 위를 아래와 같게 수정
  5. 이것을 추가
'코드 정리/코드 정리 - Tistory' 카테고리의 다른 글
  • 대표 이미지 한번에 수정 / 고정하기
  • 날짜 형식
  • 마우스 모양 변경 및 클릭시 파동 효과
  • 관리 사이드바
분석가 황규진
분석가 황규진
공공기관 위험평가관련 부서에서 근무하고 있습니다.
글쓰기 관리
분석가 황규진
HGJ's Insight
홈
|
로그인
  • 전체 글 574
    • 개인 활동(일상) 4
      • 독서 2
      • 근황 공유 1
      • 업무 관련 1
    • 개인 활동(공부) 59
      • Tableau Bootcamp 10
      • 금융 공부 11
      • 직무 공부 26
      • 강의 12
    • 개인프로젝트 4
      • 신용카드 연체 평가 모델 0
      • 대출 승인 여부 예측 모델 4
    • 자격증 7
      • 빅데이터분석기사 1
      • 정보처리기사 1
      • 경영정보시각화 1
      • SQL개발자(SQLD) 1
      • 데이터 분석 준전문가(ADsP) 1
      • 통계적품질관리(SPC) 1
      • AICE Associate 1
    • 코드 정리 11
      • 코드 정리 - Tistory 8
      • 코드 정리 - Python 3
    • 코딩테스트연습 116
      • SQL_프로그래머스 116
    • 취업사관학교 9기 199
      • 모닝스쿨 54
      • 스스로 모닝스쿨 125
      • 직무 스터디 20
      • 반성과 다짐 0
    • 빅데이터 분석가 양성과정 173
      • Python 88
      • Python - 머신러닝 26
      • Python - 딥러닝 31
      • PyQt 4
      • JavaScript 10
      • MySQL 13
      • Node.js 1
hELLO· Designed By정상우.v4.6.1
분석가 황규진
자동 목차에 제목4(h4) 추가
상단으로

티스토리툴바

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.