MediaWiki:Common.css
注意:在您發布之後,您可能需要清除瀏覽器快取才能看到變更。
- Firefox或Safari:按住Shift時點擊重新整理,或按Ctrl-F5或Ctrl-R(Mac則為⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac則為⌘-Shift-R)
- Edge:按住Ctrl時點擊重新整理,或按Ctrl-F5。
/* =========================================================
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-row:has(+ tr.infobox-section-row) > th,
table.encyclato-infobox > tbody > tr.infobox-row:has(+ tr.infobox-section-row) > td,
table.encyclato-infobox > tbody > tr.infobox-row:has(+ tr.infobox-symbol-heading) > th,
table.encyclato-infobox > tbody > tr.infobox-row:has(+ tr.infobox-symbol-heading) > td,
table.encyclato-infobox > tbody > tr.infobox-image-row:has(+ tr.infobox-section-row) > td,
table.encyclato-infobox > tbody > tr.infobox-symbol-row:has(+ tr.infobox-section-row) > td,
table.encyclato-infobox > tbody > tr.infobox-note-row:has(+ tr.infobox-section-row) > td {
padding-bottom: 0.24em !important;
border-bottom: 1px solid #a2a9b1 !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;
}