Site Notice
hello, world
Difference between revisions of "MediaWiki:Gadget-Highlight.css"
From Project-EPB Commons
([InPageEdit] 没有编辑摘要) |
m ([InPageEdit] 没有编辑摘要) |
||
Line 1: | Line 1: | ||
− | pre. | + | pre.highlight { |
font-size: 1rem; | font-size: 1rem; | ||
line-height: 1.4; | line-height: 1.4; | ||
Line 8: | Line 8: | ||
overflow-x: auto; | overflow-x: auto; | ||
} | } | ||
− | pre. | + | pre.highlight.linenums { |
padding: 0; | padding: 0; | ||
position: relative; | position: relative; | ||
} | } | ||
− | pre. | + | pre.highlight.linenums .line-container { |
position: relative; | position: relative; | ||
} | } | ||
− | pre. | + | pre.highlight.linenums .line-container .line-content { |
position: relative; | position: relative; | ||
width: calc(100% - 3em); | width: calc(100% - 3em); | ||
Line 21: | Line 21: | ||
overflow-x: auto; | overflow-x: auto; | ||
} | } | ||
− | pre. | + | pre.highlight.linenums .line-content .line-row { |
padding: 0; | padding: 0; | ||
margin: 0; | margin: 0; | ||
} | } | ||
− | pre. | + | pre.highlight.linenums .line-content .line-row::after { |
− | content: "\a0" | + | /* 行末添加不换行空格,保证空 div 的高度 */ |
+ | content: "\a0"; | ||
} | } | ||
− | pre. | + | pre.highlight.linenums .line-container .line-numbers { |
position: absolute; | position: absolute; | ||
pointer-events: none; | pointer-events: none; | ||
Line 39: | Line 40: | ||
text-align: center; | text-align: center; | ||
} | } | ||
− | pre. | + | pre.highlight.linenums .line-container .line-numbers .line-number-block { |
color: #a0a0a0; | color: #a0a0a0; | ||
} | } |
Revision as of 20:41, 29 October 2020
pre.highlight {
font-size: 1rem;
line-height: 1.4;
padding: .85em;
word-wrap: normal;
word-break: break-all;
white-space: pre;
overflow-x: auto;
}
pre.highlight.linenums {
padding: 0;
position: relative;
}
pre.highlight.linenums .line-container {
position: relative;
}
pre.highlight.linenums .line-container .line-content {
position: relative;
width: calc(100% - 3em);
left: 3em;
overflow-x: auto;
}
pre.highlight.linenums .line-content .line-row {
padding: 0;
margin: 0;
}
pre.highlight.linenums .line-content .line-row::after {
/* 行末添加不换行空格,保证空 div 的高度 */
content: "\a0";
}
pre.highlight.linenums .line-container .line-numbers {
position: absolute;
pointer-events: none;
user-select: none;
top: 0;
left: 0;
width: 3em;
padding: 0;
margin: 0;
text-align: center;
}
pre.highlight.linenums .line-container .line-numbers .line-number-block {
color: #a0a0a0;
}