主要内容居中,屏蔽部分模块。
IT之家 居中 by liweishu
Details
Authorliweishu
LicenseNo License
Categoryithome.com
Created
Updated
Size5.1 kB
Statistics
Learn how we calculate statistics in the FAQ.
Failed to fetch stats.
Description
Notes
建议配合屏蔽广告扩展。
Source code
/* ==UserStyle==
@name IT之家 居中
@version 20240412.10.47
@namespace https://userstyles.world/user/liweishu
@description 主要内容居中,屏蔽部分模块。
@author liweishu
@license No License
==/UserStyle== */
@-moz-document domain("ithome.com") {
/*通用*/
body {
min-width: 350px;
}
.bb {
max-width: 900px;
}
/*top*/
#top {
height: auto!important;
}
#top > .bb {
width: 100%!important;
}
#top #logo {
background-size: 100% auto!important;
background-position-y: center;
}
/*nav*/
#nav {
padding-top: 91px!important;
.fr {
height: 36px;
}
}
/*nav&main*/
body > .bb {
width: auto!important;
}
/*板块list*/
#list > .fl,
/*文章*/
#dt > .fl {
width: 95%!important;
margin: auto;
float: none;
}
/*摘要&文章-缩进*/
#list > .fl > ul.bl > li > .c > .m,
#paragraph > p:not([style], [class]) {
text-indent: 2em;
}
/*屏幕大小*/
@media (width<900px) {
/*top-顶部*/
#top {
.bb > a:first-child,
.bb > div {
height: 39.6px!important;
}
.fl > div,
.fr > div:nth-child(-n+3) {
margin-left: 9px!important;
border-top-width: 3.6px!important;
border-bottom-width: 3.6px!important;
}
.fl > div > a,
.fr > div:nth-child(-n+3) > a {
width: 42px!important;
}
.bb div > a {
height: 32.4px!important;
line-height: 32.4px!important;
}
.bb div > a.s:after {
top: 13px!important;
right: 0px!important;
}
.bb div > a#rm_avatar:after {
top: 18px!important;
}
#logo {
width: 51.6px!important;
margin-right: 21px!important;
}
#music {
width: 6px!important;
height: 13.2px!important;
background-size: 10.8px 24px!important;
margin: 6px 0px 0px -17.4px!important;
}
#rm_avatar {
margin-left: 6px!important;
height: 39.6px!important;
line-height: 39.6px!important;
padding-right: 18px!important;
}
#rm_avatar:after {
padding-right: 6px!important;
}
#toplogin img {
width: 21.6px!important;
height: 21.6px!important;
margin-top: 9.2px!important;
margin-right: 6px!important;
}
}
/*top-下拉*/
#top.su {
.bb > a:first-child,
.bb > div {
height: 23.76px!important;
}
.fl > div,
.fr > div:nth-child(-n+3) {
margin-left: 5.4px!important;
border-top-width: 2.16px!important;
border-bottom-width: 2.16px!important;
}
.fl > div > a,
.fr > div:nth-child(-n+3) > a {
width: 30px!important;
}
.bb div > a {
height: 19.44px!important;
line-height: 19.44px!important;
}
.bb div > a.s:after {
top: 6.5px!important;
right: 0px!important;
}
.bb div > a#rm_avatar:after {
top: 9px!important;
}
#logo {
width: 30.96px!important;
margin-right: 12.6px!important;
}
#music {
width: 3.6px!important;
height: 7.92px!important;
background-size: 6.48px 14.4px!important;
margin: 2.16px 0px 0px -10.44px!important;
}
.bb > div #toplogin.mt a {
margin-left: 3.6px!important;
height: 23.76px!important;
line-height: 24px!important;
padding-right: 10.8px!important;
}
.bb > div #toplogin.mt a:after {
padding-right: 3.6px!important;
}
#toplogin img {
width: 12.96px!important;
height: 12.96px!important;
margin-top: 5.52px!important;
margin-right: 3.6px!important;
}
}
/*nav*/
#nav {
padding-top: 64.6px!important;
}
}
@media (width<650px) {
#nav .fl > div {
width: 320px;
}
}
@media (width<594px) {
#nav {
padding-top: 104.2px!important;
}
}
@media (width<410px) {
/*top-小介面隐藏用户名*/
#toplogin a {
width: 25.2px!important;
padding-right: 10px!important;
overflow: hidden!important;
}
}
}
@-moz-document regexp("https?://www\\.ithome\\.com/[A-za-z]+/"), regexp("https?://(?<!www).*\\.ithome\\.com/[A-za-z]*/?") {
/*板块list*/
/*摘要*/
#list > .fl > ul.bl > li > .c {
width: calc(100% - 195px)!important;
}
#list > .fl > ul.bl > li > .c > h2 {
width: fit-content;
margin-left: auto;
margin-right: auto;
}
/*Tags*/
#list > .fl > ul.bl > li > .c > .o {
margin-left: 10px;
}
/*Tags time*/
#dt > .fl > .cv + h1 {
width: fit-content;
margin: 25px auto 0;
}
/*摘要*/
@media (width< = 1320px) {
#list > .fl > ul.bl > li > .c {
width: calc(100% - 175px)!important;
}
}
@media (width<650px) {
#list > .fl > ul.bl > li {
a,
img {
width: 120px;
height: 90px;
}
.c {
width: calc(100% - 130px)!important;
}
}
}
/*@media (width<410px) {
#list > .fl > ul.bl > li {
a,img{
width: 80px;
height: 60px;
}
.c {
width: calc(100% - 85px)!important;
}}
}*/
}
@-moz-document regexp("https?://www\\.ithome\\.com/[A-za-z]+/") {
/*主站板块list*/
/*nav*/
@media (width<410px) {
#nav {
height: 117px;
}
#list {
margin-top: 10px;
}
}
}
@-moz-document regexp("https?://(?<!www).*\\.ithome\\.com/[A-za-z]*/?") {
/*子站板块List*/
/*nav*/
#nav {
padding-top: 71px;
}
.domain-nav.bb{
overflow: auto;
height: auto;
.sel{
box-sizing: border-box;
}
}
}
@-moz-document domain("ithome.com") {
/*屏蔽*/
/*top软媒应用*/
#menu-app,
/*nav热搜*/
#nav > .fr > .hotkeyword,
/*大家在看*/
div.fl.content:first-child > iframe:nth-last-child(2) {
display: none;
}
}