萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 程式設計 >  >> 網頁製作 >> Div CSS 教學

多說評論框深度自訂:隱藏分享、背景、按鈕、版權與字體調整全攻略

前言

多說(Duoshuo)曾是國內廣泛使用的社交評論插件,雖已停止服務,但許多舊專案仍在維護。本文整理常見自訂 CSS 技巧,幫助你快速調整評論框外觀。

常用自訂 CSS 片段

1. 隱藏評論框底部分享按鈕(微博、QQ 空間等)

.ds-sync {
  display: none !important;
} /* 隱藏評論框底部分享 */

2. 自訂評論框背景圖片

.ds-textarea-wrapper.ds-rounded-top {
  background: #ffffff url(你的圖片絕對路徑) no-repeat right bottom !important;
} /* 定義評論框背景 */

提示:建議使用絕對路徑確保圖片正確載入。

3. 隱藏評論框底部漸層背景

#ds-reset .ds-gradient-bg {
  background: none !important;
} /* 移除底部漸層,變透明 */

4. 設定評論輸入框字體

#ds-thread #ds-reset .ds-textarea-wrapper textarea,
#ds-thread #ds-reset .ds-textarea-wrapper .ds-hidden-text {
  font-family: '微軟雅黑', 'Microsoft Yahei' !important;
  font-size: 12px;
  letter-spacing: 1px;
} /* 定義輸入框字體 */

5. 自訂發布按鈕樣式

#ds-thread #ds-reset .ds-post-button {
  font-family: '微軟雅黑', 'Microsoft Yahei' !important;
  font-weight: bold;
  font-size: 12px;
  background: none !important;
  color: #49976b !important;
} /* 定義發布按鈕字體與背景 */

6. 隱藏評論區塊右上角排序(最新/最熱)

#ds-thread #ds-reset .ds-sort {
  display: none;
} /* 隱藏最新最熱等 */

7. 隱藏左上角評論總數背景與邊框

#ds-thread #ds-reset li.ds-tab a.ds-current {
  background: none;
  border: none;
} /* 隱藏評論總數背景及邊框 */

8. 隱藏底部多說版權標識

#ds-thread #ds-reset .ds-powered-by {
  display: none;
} /* 隱藏多說底部版權 */

9. 統一高亮文字顏色(配合主題色系)

#ds-reset .ds-highlight { color: #49976b !important; }
#ds-thread #ds-reset #ds-bubble a { color: #49976b !important; }
#ds-thread #ds-reset #ds-bubble { color: #49976b !important; }
#ds-reset #ds-ctx .ds-ctx-entry .ds-ctx-head a { color: #49976b !important; }
#ds-thread #ds-reset a.ds-comment-context:hover { color: #49976b !important; }
#ds-thread #ds-reset a.ds-comment-context { color: #49976b !important; }

使用說明

  • 將上述 CSS 加入你的主題樣式表或頁面 <style> 中。
  • 顏色值 #49976b 可替換為你的品牌主色調。
  • 若樣式未生效,請檢查選擇器權重,必要時加 !important 或提高優先級。

遷移提醒

多說官方已於 2017 年關閉服務,建議新專案採用 Gitalk、Valine、Waline、Twikoo 等現代靜態評論系統,擁有更好資料掌控權與擴展性。

copyright © 萬盛學電腦網 all rights reserved