You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何用Tampermonkey脚本修改vBulletin论坛帖子标题背景色

解决vBulletin论坛帖子标题区域背景色修改问题

你的脚本未能修改帖子标题区域背景色,是因为该区域元素使用了更具体的CSS规则,甚至可能包含背景图片。以下是修正后的脚本,专门针对帖子标题栏添加样式:

// ==UserScript==
// @name         vBulletin Forum Dark Mode
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Enable dark mode for vBulletin forum posts
// @author       Me
// @match        https://www.cfd-online.com/*
// @grant        GM_addStyle
// ==/UserScript==

(function() {
    'use strict';

    // Add custom CSS styles for dark mode
    GM_addStyle(`
        /* Dark mode styles */
        .alt1, .alt2, .aalt1, .aalt2, table, tbody, tr, .thead, .tborder, #posts, .smallfont td {
            background-color: #1e1e1e !important;
            color: #dcdcdc !important;
        }

        a, .smallfont {
            color: #81a2be !important;
        }

        /* 专门修改帖子标题栏的背景色为黑色 */
        .tborder .thead {
            background-color: #000000 !important;
            background-image: none !important; /* 移除可能存在的背景图片/渐变 */
        }

        /* Add more styles here as needed */
    `);

})();

关键修改说明:

  • 添加 .tborder .thead 选择器,精准定位帖子标题栏元素(每个帖子容器内的表头行)
  • 新增 background-image: none !important 清除原论坛的背景渐变或图片,确保黑色背景生效
  • 提升选择器特异性,优先覆盖论坛默认样式

内容的提问来源于stack exchange,提问作者Amazigh_05

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.24 14:17:07