.copy_code{ z-index: 2; transition: all .3s; display: none; position: absolute; color: #ddd; background-color: transparent; right: 5px; top: 9px; font-size: 12px; line-height: 12px; padding: 3px 5px; border: 1px solid; border-radius: 4px; } pre code ul { list-style: decimal; margin: 0px 0px 0 35px !important; padding: 0px; font-size: 14px; color: #F5F5F5; border-left: 1px solid #696969; } pre code ul li { list-style: decimal; padding: 5px!important; margin: 0 !important; font-family: SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace; line-height: 14px; word-break: break-all; word-wrap: break-word; } pre code ul li:nth-of-type(even) { color: inherit; } /*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/ pre code::-webkit-scrollbar{ width: 5px; height: 8px; background-color: rgba(255,255,255,0); } /*定义滚动条轨道 内阴影+圆角*/ pre code::-webkit-scrollbar-track{ -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); border-radius: 10px; background-color: rgba(255,255,255,0); } /*定义滑块 内阴影+圆角*/ pre code::-webkit-scrollbar-thumb{ border-radius: 10px; -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3); background-color: #555; } pre code::-webkit-scrollbar-corner { /* background: transparent!important; */ } pre code:-webkit-scrollbar { /* width: 8px!important; */ height: 8px!important; } pre code::-webkit-scrollbar-thumb { border-radius: 5px!important; background-color: #777!important; } pre code::-webkit-scrollbar-track-piece { background: #21252a!important } pre code::-webkit-scrollbar-thumb:hover { background-color: #888!important } pre code::-webkit-scrollbar-thumb:active { background-color: #999!important } pre,article pre{ max-height: calc(100vh - 250px); overflow: auto; padding: 0; margin-left: 2px; background: #161616; min-height: 100%; position: relative; padding-top: 30px; overflow-y: hidden; } .btn-copy-code { transition:all .3s; opacity:0; position:absolute; color:#ddd; background-color:transparent; right:6px; top:4px; font-size:10px; line-height:12px; padding:3px 5px; border:1px solid; border-radius:4px } .btn-copy-code:hover { color:#fff } pre:hover .btn-copy-code { opacity:1 }