MediaWiki:Common.css:修訂間差異
跳至導覽
跳至搜尋
無編輯摘要 |
無編輯摘要 |
||
| (未顯示同一使用者於中間所作的 1次修訂) | |||
| 第478行: | 第478行: | ||
border-collapse: collapse !important; | border-collapse: collapse !important; | ||
border-spacing: 0 !important; | border-spacing: 0 !important; | ||
} | |||
/* Template:歷史朝代資訊面板/styles.css */ | |||
table.dynasty-info-table { | |||
width: 100%; | |||
margin: 1em 0; | |||
border: 1px solid #a2a9b1; | |||
border-collapse: collapse; | |||
border-spacing: 0; | |||
background: #fff; | |||
color: #202122; | |||
font-size: 95%; | |||
line-height: 1.45; | |||
} | |||
table.dynasty-info-table > caption { | |||
padding: 0.55em 0.7em; | |||
border: 1px solid #a2a9b1; | |||
border-bottom: 0; | |||
background: #eaecf0; | |||
font-size: 125%; | |||
font-weight: 700; | |||
text-align: center; | |||
} | |||
table.dynasty-info-table > tbody > tr > th, | |||
table.dynasty-info-table > tbody > tr > td { | |||
padding: 0.42em 0.6em; | |||
border: 1px solid #c8ccd1; | |||
vertical-align: middle; | |||
} | |||
table.dynasty-info-table > tbody > tr.dynasty-info-head > th { | |||
background: #eaecf0; | |||
font-weight: 700; | |||
text-align: center; | |||
} | |||
table.dynasty-info-table .dynasty-col-period { | |||
width: 12%; | |||
} | |||
table.dynasty-info-table .dynasty-col-name { | |||
width: 16%; | |||
} | |||
table.dynasty-info-table .dynasty-col-date { | |||
width: 19%; | |||
} | |||
table.dynasty-info-table .dynasty-col-story { | |||
width: 53%; | |||
} | |||
table.dynasty-info-table .dynasty-period { | |||
background: #f1f3f5; | |||
font-weight: 700; | |||
text-align: center; | |||
vertical-align: middle; | |||
} | |||
table.dynasty-info-table .dynasty-name { | |||
background: #fff; | |||
font-weight: 600; | |||
text-align: center; | |||
} | |||
table.dynasty-info-table .dynasty-date { | |||
background: #fff; | |||
text-align: center; | |||
white-space: nowrap; | |||
} | |||
table.dynasty-info-table .dynasty-story { | |||
background: #fff; | |||
text-align: left; | |||
} | |||
table.dynasty-info-table > tbody > tr.dynasty-data-row:hover > td, | |||
table.dynasty-info-table > tbody > tr.dynasty-data-row:hover > th { | |||
background-color: #f8f9fa; | |||
} | |||
table.dynasty-info-table > tbody > tr.dynasty-hidden { | |||
display: none; | |||
} | |||
@media screen and (max-width: 720px) { | |||
table.dynasty-info-table { | |||
font-size: 90%; | |||
} | |||
table.dynasty-info-table > tbody > tr > th, | |||
table.dynasty-info-table > tbody > tr > td { | |||
padding: 0.34em 0.4em; | |||
} | |||
table.dynasty-info-table .dynasty-date { | |||
white-space: normal; | |||
} | |||
} | } | ||
2026年9月18日 (五) 04:32的最新修訂
/* =========================================================
Encyclato 資訊面板
維基風格・靠右・分隔版
請用這份完整取代舊的資訊面板 CSS
========================================================= */
/* -------------------------
1. 資訊面板本體
------------------------- */
table.encyclato-infobox {
float: right !important;
clear: right !important;
width: 22em;
max-width: calc(100% - 1em);
margin: 0 0 1em 1.25em !important;
border: 1px solid #a2a9b1;
border-collapse: collapse;
border-spacing: 0;
background: #f8f9fa;
color: #202122;
font-size: 90%;
line-height: 1.24;
box-sizing: border-box;
}
/* -------------------------
2. 主標題
------------------------- */
table.encyclato-infobox > caption {
padding: 0.55em 0.6em;
border: 1px solid #a2a9b1;
border-bottom: 0;
background: #f8f9fa;
color: #202122;
font-size: 125%;
font-weight: 700;
line-height: 1.35;
text-align: center;
}
table.encyclato-infobox .infobox-native-name {
font-size: 80%;
font-weight: 400;
}
/* -------------------------
3. 一般儲存格
------------------------- */
table.encyclato-infobox > tbody > tr > th,
table.encyclato-infobox > tbody > tr > td {
box-sizing: border-box;
padding: 0.10em 0.48em;
border-bottom: 1px solid #eaecf0;
vertical-align: middle;
}
/* -------------------------
4. 左側欄名
------------------------- */
table.encyclato-infobox > tbody > tr > th.infobox-label {
width: 38%;
background: #f8f9fa;
font-weight: 600;
text-align: center;
border-right: 1px solid #eaecf0;
}
/* 右側內容 */
table.encyclato-infobox > tbody > tr > th.infobox-label + td {
width: 62%;
background: #ffffff;
text-align: left;
overflow-wrap: anywhere;
}
/* 二字、三字、四字欄名整齊排版 */
table.encyclato-infobox .infobox-label-text {
display: inline-block;
width: 4em;
text-align: justify;
text-align-last: justify;
text-justify: inter-character;
white-space: nowrap;
}
/* 動態欄名不要硬撐四字 */
table.encyclato-infobox > tbody > tr > th.infobox-label-dynamic {
white-space: normal;
line-height: 1.35;
}
/* -------------------------
5. 大分類標題
------------------------- */
table.encyclato-infobox > tbody > tr > th.infobox-section {
width: auto;
padding: 0.28em 0.55em;
border-top: 0;
border-bottom: 1px solid #a2a9b1;
background: #eaecf0;
color: #202122;
font-weight: 700;
text-align: center;
letter-spacing: 0.05em;
}
/* -------------------------
6. 次級分類
例如人物公職名稱
------------------------- */
table.encyclato-infobox > tbody > tr > th.infobox-subsection {
padding: 0.24em 0.55em;
border-top: 0;
border-bottom: 1px solid #c8ccd1;
background: #f1f3f5;
font-weight: 700;
text-align: center;
}
/* -------------------------
7. 國旗與國徽
------------------------- */
table.encyclato-infobox > tbody > tr.infobox-symbol-row > td {
width: 50%;
padding: 0.4em 0.4em 0.35em;
background: #ffffff;
text-align: center;
vertical-align: middle;
}
table.encyclato-infobox > tbody > tr.infobox-symbol-row > td + td {
border-left: 1px solid #eaecf0;
}
table.encyclato-infobox .infobox-symbol-name {
display: block;
margin-bottom: 0.3em;
font-weight: 600;
text-align: center;
}
table.encyclato-infobox .infobox-symbol-media {
display: block;
width: 100%;
min-height: 0;
height: auto;
margin: 0;
padding: 0;
line-height: 0;
text-align: center;
}
table.encyclato-infobox .infobox-symbol-media img {
display: inline-block;
max-width: 100%;
max-height: none;
width: auto;
height: auto;
margin: 0;
padding: 0;
vertical-align: middle;
}
/* -------------------------
8. 地圖、人物圖像
------------------------- */
table.encyclato-infobox .infobox-wide-image,
table.encyclato-infobox .infobox-image-cell {
background: #ffffff;
text-align: center;
vertical-align: middle;
}
table.encyclato-infobox .infobox-wide-image img,
table.encyclato-infobox .infobox-image-cell img {
max-width: 100%;
height: auto;
margin: 0 auto;
}
/* -------------------------
9. 簽名
------------------------- */
table.encyclato-infobox .infobox-signature-cell {
background: #ffffff;
text-align: center;
vertical-align: middle;
}
table.encyclato-infobox .infobox-signature-cell img {
max-width: 150px;
max-height: 80px;
width: auto;
height: auto;
}
/* -------------------------
10. 備註
------------------------- */
table.encyclato-infobox .infobox-note {
padding: 0.55em 0.65em;
background: #ffffff;
font-size: 85%;
}
/* -------------------------
11. 空白列
------------------------- */
table.encyclato-infobox > tbody > tr.infobox-hidden {
display: none !important;
}
/* -------------------------
12. 圖片保護
------------------------- */
table.encyclato-infobox img {
max-width: 100%;
height: auto;
}
/* -------------------------
13. 連續資訊面板
------------------------- */
table.encyclato-infobox + table.encyclato-infobox {
clear: right;
}
/* -------------------------
14. 窄螢幕
注意:不再取消 float
因此不會突然跑到正文正上方
------------------------- */
@media screen and (max-width: 520px) {
table.encyclato-infobox {
float: right !important;
clear: right !important;
width: 21em;
max-width: calc(100% - 0.5em);
margin: 0 0 1em 0.75em !important;
}
table.encyclato-infobox > caption {
font-size: 120%;
}
table.encyclato-infobox > tbody > tr > th.infobox-label {
width: 39%;
}
table.encyclato-infobox > tbody > tr > th.infobox-label + td {
width: 61%;
}
}
/* -------------------------
15. 儲存格內多餘下方空白修正
------------------------- */
/* 一般文字不要額外撐高 */
table.encyclato-infobox > tbody > tr > th,
table.encyclato-infobox > tbody > tr > td {
min-height: 0;
}
/* 若儲存格裡有段落,移除段落預設上下邊距 */
table.encyclato-infobox > tbody > tr > th p,
table.encyclato-infobox > tbody > tr > td p {
margin: 0;
}
/* 清單若出現在資訊框內,避免上下多留一截 */
table.encyclato-infobox > tbody > tr > th ul,
table.encyclato-infobox > tbody > tr > th ol,
table.encyclato-infobox > tbody > tr > td ul,
table.encyclato-infobox > tbody > tr > td ol {
margin-top: 0.15em;
margin-bottom: 0.15em;
}
/* 最後一列不再多畫底線 */
table.encyclato-infobox > tbody > tr:last-child > th,
table.encyclato-infobox > tbody > tr:last-child > td {
border-bottom: 0;
}
/* =========================================================
國旗/國徽空白高度最終修正
========================================================= */
table.encyclato-infobox > tbody > tr.infobox-symbol-row p {
margin: 0;
padding: 0;
}
table.encyclato-infobox > tbody > tr.infobox-symbol-row br:first-child,
table.encyclato-infobox > tbody > tr.infobox-symbol-row br:last-child {
display: none;
}
/* =========================================================
一般欄位緊湊化
只縮短「通稱 / 別稱 / 國家狀態 / 首都 / 政體」這類資料列
不影響國旗、國徽、地圖、人物照片
========================================================= */
table.encyclato-infobox > tbody > tr.infobox-row > th,
table.encyclato-infobox > tbody > tr.infobox-row > td {
padding-top: 0.08em !important;
padding-bottom: 0.08em !important;
line-height: 1.22;
}
table.encyclato-infobox > tbody > tr.infobox-row > th.infobox-label {
min-height: 0;
}
table.encyclato-infobox > tbody > tr.infobox-row > td {
min-height: 0;
}
/* =========================================================
區塊緊貼修正
讓上一區最後一列直接接到下一個區段標題
========================================================= */
table.encyclato-infobox > tbody > tr > th.infobox-section,
table.encyclato-infobox > tbody > tr > th.infobox-subsection {
border-top: 0 !important;
margin-top: 0 !important;
}
/* 區段標題本身不額外製造外部空隙 */
table.encyclato-infobox > tbody > tr.infobox-section-row,
table.encyclato-infobox > tbody > tr.infobox-symbol-heading {
margin: 0 !important;
padding: 0 !important;
}
/* =========================================================
區塊銜接最終版
目的:
1. 不再用 box-shadow 往上蓋,避免遮到上一列文字
2. 每個區塊最後一列多一點下方空間
3. 每個區塊最後一列增加清楚的底線
4. 下一個區塊標題直接銜接,不留白縫
========================================================= */
/* 所有大區塊標題都直接接在上一列後面 */
table.encyclato-infobox > tbody > tr.infobox-section-row > th.infobox-section,
table.encyclato-infobox > tbody > tr.infobox-symbol-heading > th.infobox-section {
border-top: 0 !important;
box-shadow: none !important;
margin-top: 0 !important;
}
/* 次級區塊亦同 */
table.encyclato-infobox > tbody > tr > th.infobox-subsection {
border-top: 0 !important;
box-shadow: none !important;
}
/* 每個區塊第一列不要被上一個分隔規則擠出空白 */
table.encyclato-infobox > tbody > tr.infobox-section-row + tr > th,
table.encyclato-infobox > tbody > tr.infobox-section-row + tr > td,
table.encyclato-infobox > tbody > tr.infobox-symbol-heading + tr > th,
table.encyclato-infobox > tbody > tr.infobox-symbol-heading + tr > td {
margin-top: 0 !important;
}
/* 保證表格儲存格之間完全沒有 spacing */
table.encyclato-infobox {
border-collapse: collapse !important;
border-spacing: 0 !important;
}
/* =========================================================
MediaWiki 相容的區塊分隔
不使用 :has(),避免 CSS 驗證錯誤
========================================================= */
/*
* 因為 CSS 無法在不使用 :has() 的情況下
* 自動選中「下一個區塊前的最後一列」,
* 所以改成把分隔線畫在下一個區塊標題的最上方。
* 視覺效果等同於上一區最後一列的底線。
*/
table.encyclato-infobox > tbody > tr.infobox-section-row > th.infobox-section,
table.encyclato-infobox > tbody > tr.infobox-symbol-heading > th.infobox-section,
table.encyclato-infobox > tbody > tr > th.infobox-subsection {
border-top: 1px solid #a2a9b1 !important;
box-shadow: none !important;
margin-top: 0 !important;
}
/* 區塊標題留一點呼吸空間,但不產生白縫 */
table.encyclato-infobox > tbody > tr.infobox-section-row > th.infobox-section,
table.encyclato-infobox > tbody > tr.infobox-symbol-heading > th.infobox-section {
padding-top: 0.34em !important;
padding-bottom: 0.34em !important;
}
/* 一般資料列保留足夠字體高度,避免被分隔線壓到 */
table.encyclato-infobox > tbody > tr.infobox-row > th,
table.encyclato-infobox > tbody > tr.infobox-row > td {
padding-top: 0.10em !important;
padding-bottom: 0.14em !important;
line-height: 1.24 !important;
}
/* 表格儲存格之間不留額外 spacing */
table.encyclato-infobox {
border-collapse: collapse !important;
border-spacing: 0 !important;
}
/* Template:歷史朝代資訊面板/styles.css */
table.dynasty-info-table {
width: 100%;
margin: 1em 0;
border: 1px solid #a2a9b1;
border-collapse: collapse;
border-spacing: 0;
background: #fff;
color: #202122;
font-size: 95%;
line-height: 1.45;
}
table.dynasty-info-table > caption {
padding: 0.55em 0.7em;
border: 1px solid #a2a9b1;
border-bottom: 0;
background: #eaecf0;
font-size: 125%;
font-weight: 700;
text-align: center;
}
table.dynasty-info-table > tbody > tr > th,
table.dynasty-info-table > tbody > tr > td {
padding: 0.42em 0.6em;
border: 1px solid #c8ccd1;
vertical-align: middle;
}
table.dynasty-info-table > tbody > tr.dynasty-info-head > th {
background: #eaecf0;
font-weight: 700;
text-align: center;
}
table.dynasty-info-table .dynasty-col-period {
width: 12%;
}
table.dynasty-info-table .dynasty-col-name {
width: 16%;
}
table.dynasty-info-table .dynasty-col-date {
width: 19%;
}
table.dynasty-info-table .dynasty-col-story {
width: 53%;
}
table.dynasty-info-table .dynasty-period {
background: #f1f3f5;
font-weight: 700;
text-align: center;
vertical-align: middle;
}
table.dynasty-info-table .dynasty-name {
background: #fff;
font-weight: 600;
text-align: center;
}
table.dynasty-info-table .dynasty-date {
background: #fff;
text-align: center;
white-space: nowrap;
}
table.dynasty-info-table .dynasty-story {
background: #fff;
text-align: left;
}
table.dynasty-info-table > tbody > tr.dynasty-data-row:hover > td,
table.dynasty-info-table > tbody > tr.dynasty-data-row:hover > th {
background-color: #f8f9fa;
}
table.dynasty-info-table > tbody > tr.dynasty-hidden {
display: none;
}
@media screen and (max-width: 720px) {
table.dynasty-info-table {
font-size: 90%;
}
table.dynasty-info-table > tbody > tr > th,
table.dynasty-info-table > tbody > tr > td {
padding: 0.34em 0.4em;
}
table.dynasty-info-table .dynasty-date {
white-space: normal;
}
}