MediaWiki:Common.css

出自眾神廳
LatO留言 | 貢獻2026年9月18日 (五) 03:21的修訂
跳至導覽 跳至搜尋

注意:在您發布之後,您可能需要清除瀏覽器快取才能看到變更。

  • Firefox或Safari:按住Shift時點擊重新整理,或按Ctrl-F5Ctrl-R(Mac則為⌘-R
  • Google Chrome:Ctrl-Shift-R(Mac則為⌘-Shift-R
  • Edge:按住Ctrl時點擊重新整理,或按Ctrl-F5
/* 此 CSS 會套用至所有的介面外觀 */
/* ==================================================
   Encyclato 資訊面板統一樣式
   建議貼到 MediaWiki:Common.css 最下方
================================================== */

.infobox {
    float: right;
    clear: right;

    width: 22em;
    max-width: 100%;

    margin: 0 0 1em 1.5em;

    border: 1px solid #a2a9b1;
    border-collapse: collapse;

    background: #f8f9fa;

    color: #202122;
    font-size: 90%;
    line-height: 1.5;
}

/* 面板主標題 */
.infobox caption {
    padding: 0.7em 0.55em;

    background: #f8f9fa;

    font-size: 130%;
    font-weight: 700;
    text-align: center;
}

/* 一般儲存格 */
.infobox th,
.infobox td {
    box-sizing: border-box;
    padding: 0.42em 0.6em;
    vertical-align: top;
}

/* 左側欄位名稱 */
.infobox th.infobox-label {
    width: 38%;

    border-right: 1px solid #eaecf0;
    border-bottom: 1px solid #eaecf0;

    background: #f8f9fa;

    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

/* 右側欄位內容 */
.infobox th.infobox-label + td {
    border-bottom: 1px solid #eaecf0;
    text-align: left;
}

/*
 * 二字、三字、四字欄位統一佔 4 個中文字寬度。
 *
 * 例:
 * 首  都
 * 所 屬 洲
 * 官 方 語 言
 *
 * text-align-last: justify 會把字距平均分配,
 * 讓不同字數看起來仍然整齊。
 */
.infobox .infobox-label-text {
    display: inline-block;
    width: 4em;

    text-align: justify;
    text-align-last: justify;
    text-justify: inter-character;
}

/* 動態欄位,例如領袖職稱、建立事件名稱 */
.infobox th.infobox-label-dynamic {
    white-space: normal;
    text-align: center;
}

/* 大分類標題:基本資料、政治、地理、國防等 */
.infobox .infobox-section {
    width: auto;

    padding: 0.55em 0.6em;

    border-top: 6px solid #ffffff;
    border-bottom: 1px solid #a2a9b1;

    background: #eaecf0;

    font-weight: 700;
    text-align: center;
    letter-spacing: 0.08em;
}

/* 國旗與國徽並排 */
.infobox .infobox-symbol-cell {
    width: 50%;

    padding: 0.65em 0.35em;

    text-align: center;
    vertical-align: top;
}

/* 國旗與國徽圖片使用同高展示區,避免上下亂跳 */
.infobox .infobox-symbol-media {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 120px;
}

/* 國旗 / 國徽名稱 */
.infobox .infobox-symbol-name {
    display: block;
    margin-bottom: 0.15em;
    text-align: center;
}

/* 圖片不得撐破資訊框 */
.infobox img {
    max-width: 100%;
    height: auto;
}

/* 窄螢幕 */
@media screen and (max-width: 720px) {
    .infobox {
        float: none;
        clear: both;

        width: auto;
        max-width: 100%;

        margin: 1em 0;
    }

    .infobox th.infobox-label {
        width: 36%;
    }

    .infobox .infobox-section {
        border-top-width: 4px;
    }
}