MediaWiki:Minerva.css

From ChinaEnglish
Revision as of 14:36, 31 October 2026 by Chinaenglish (talk | contribs)
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/* All CSS here will be loaded for users of the MinervaNeue skin */




/* 仅在查看首页时,针对 Minerva 皮肤生效 */
body.skin-minerva.page-Main_Page .header-container .branding-box h1 {
    /* 1. 将文字颜色设为透明,使其不可见 */
    color: transparent !important;
    
    /* 2. 移除文字本身的背景,准备用图片作为背景 */
    background-color: transparent !important;
    
    /* 3. 用你的图片作为背景 */
    background-image: url("http://www.chinaenglish.com/images/HomeBanner.png");
    background-repeat: no-repeat;
    background-position: left center; /* 图片靠左,垂直居中 */
    background-size: contain; /* 或者使用 cover,根据图片比例调整 */
    
    /* 4. 根据图片高度调整这里的高度,确保图片能完整显示 */
    height: 40px; /* 示例高度,请按需修改 */
    width: 200px;  /* 示例宽度,请按需修改 */
    
    /* 保证文字透明后,原文字依然占据空间,从而“撑开”图片区域 */
    text-indent: -9999px; 
    overflow: hidden;
}