Comments 6Leo started the conversationAugust 16, 2024 at 8:04pmI have created a css for the article H2 style ,but after typing this , it makes my menu fonts become small , how to make the code not influence the menu? /* 初始化計數器 */body { counter-reset: h2counter; } /* 為每個 h2 標題遞增計數器 */h2.wp-block-heading { counter-increment: h2counter;} /* 在 h2 標題前顯示計數器 */h2.wp-block-heading::before { content: counter(h2counter) ' '; display: inline-block; font-size: 1em; margin-right: 0.6em; width: 1.6em; line-height: 1.6em; text-align: center; border-radius: 10%; color: #FFF; background-color: rgb(23, 42, 136); /* Navy Blue */} /* 添加底線給 h2 標題 */h2.wp-block-heading { border-bottom: 2px solid rgb(23, 42, 136); /* Navy Blue */ padding-bottom: 5px; /* 調整底線和文字間距 */ 6Leo repliedAugust 16, 2024 at 9:49pmOh I figured it out , thx Sign in to reply ...
I have created a css for the article H2 style ,but after typing this , it makes my menu fonts become small , how to make the code not influence the menu?
/* 初始化計數器 */
body { counter-reset: h2counter; }
/* 為每個 h2 標題遞增計數器 */
h2.wp-block-heading { counter-increment: h2counter;
}
/* 在 h2 標題前顯示計數器 */
h2.wp-block-heading::before { content: counter(h2counter) ' '; display: inline-block; font-size: 1em; margin-right: 0.6em; width: 1.6em; line-height: 1.6em; text-align: center; border-radius: 10%; color: #FFF; background-color: rgb(23, 42, 136); /* Navy Blue */
}
/* 添加底線給 h2 標題 */
h2.wp-block-heading { border-bottom: 2px solid rgb(23, 42, 136); /* Navy Blue */ padding-bottom: 5px; /* 調整底線和文字間距 */
Oh I figured it out , thx