discuz论坛自定义个人空间css样式

  • discuz论坛自定义个人空间css样式已关闭评论
  • 40 次浏览
  • A+
所属分类:Web前端

很多Discuz论坛的个人主题页很漂亮,这些都是直接CSS插入的效果,并非是自装扮空间哦!具体教程如下:

1、复制以下代码
mycss=prompt('请输入你需要的CSS');
formhash=document.querySelector('input[name=formhash]').value;
fetch("/home.php?mod=spacecp&ac=index", {"credentials":"include","headers":{"content-type":"application/x-www-form-urlencoded"},"body":"spacecss="
+ encodeURIComponent(mycss) + "&formhash=" + formhash + "&style=t8&layoutdata=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22ISO-8859-1%22%3F%3E%3Croot%3E%3Citem+id%3D%22diypage%22%3E%3Citem+id%3D%22frame%60frame1%22%3E%3Citem+id%3D%22attr%22%3E%3Citem+id%3D%22name%22%3E%3C%21%5BCDATA%5Bframe1%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22moveable%22%3E%3C%21%5BCDATA%5Bfalse%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22className%22%3E%3C%21%5BCDATA%5Bframe+cl%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22titles%22%3E%3C%2Fitem%3E%3C%2Fitem%3E%3Citem+id%3D%22column%60frame1_left%22%3E%3Citem+id%3D%22attr%22%3E%3Citem+id%3D%22name%22%3E%3C%21%5BCDATA%5Bframe1_left%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22className%22%3E%3C%21%5BCDATA%5Bz+column%5D%5D%3E%3C%2Fitem%3E%3C%2Fitem%3E%3Citem+id%3D%22block%60profile%22%3E%3Citem+id%3D%22attr%22%3E%3Citem+id%3D%22name%22%3E%3C%21%5BCDATA%5Bprofile%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22className%22%3E%3C%21%5BCDATA%5Bblock+move-span%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22titles%22%3E%3Citem+id%3D%220%22%3E%3Citem+id%3D%22text%22%3E%3C%21%5BCDATA%5B%E5%A4%B4%E5%83%8F%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22href%22%3E%3C%21%5BCDATA%5Bhttps%3A%2F%2Fwww.hostloc.com%2Fhome.php%3Fmod%3Dspace%26uid%3D27573%26do%3Dprofile%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22color%22%3E%3C%21%5BCDATA%5B+%21important%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22float%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22margin%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22font-size%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22className%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22src%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3C%2Fitem%3E%3Citem+id%3D%22className%22%3E%3Citem+id%3D%220%22%3E%3C%21%5BCDATA%5Bblocktitle+title%5D%5D%3E%3C%2Fitem%3E%3C%2Fitem%3E%3Citem+id%3D%22style%22%3E%3C%2Fitem%3E%3C%2Fitem%3E%3C%2Fitem%3E%3C%2Fitem%3E%3Citem+id%3D%22block%60personalinfo%22%3E%3Citem+id%3D%22attr%22%3E%3Citem+id%3D%22name%22%3E%3C%21%5BCDATA%5Bpersonalinfo%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22className%22%3E%3C%21%5BCDATA%5Bblock+move-span%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22titles%22%3E%3Citem+id%3D%220%22%3E%3Citem+id%3D%22text%22%3E%3C%21%5BCDATA%5B%E4%B8%AA%E4%BA%BA%E8%B5%84%E6%96%99%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22href%22%3E%3C%21%5BCDATA%5Bhttps%3A%2F%2Fwww.hostloc.com%2Fhome.php%3Fmod%3Dspace%26uid%3D27573%26do%3Dprofile%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22color%22%3E%3C%21%5BCDATA%5B+%21important%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22float%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22margin%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22font-size%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22className%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22src%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3C%2Fitem%3E%3Citem+id%3D%221%22%3E%3Citem+id%3D%22text%22%3E%3C%21%5BCDATA%5B%E7%BC%96%E8%BE%91%E6%88%91%E7%9A%84%E8%B5%84%E6%96%99%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22href%22%3E%3C%21%5BCDATA%5Bhttps%3A%2F%2Fwww.hostloc.com%2Fhome.php%3Fmod%3Dspacecp%26ac%3Dprofile%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22color%22%3E%3C%21%5BCDATA%5B+%21important%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22float%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22margin%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22font-size%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22className%22%3E%3C%21%5BCDATA%5By+xw0%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22src%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3C%2Fitem%3E%3Citem+id%3D%22className%22%3E%3Citem+id%3D%220%22%3E%3C%21%5BCDATA%5Bblocktitle+title%5D%5D%3E%3C%2Fitem%3E%3C%2Fitem%3E%3Citem+id%3D%22style%22%3E%3C%2Fitem%3E%3C%2Fitem%3E%3C%2Fitem%3E%3C%2Fitem%3E%3Citem+id%3D%22block%60friend%22%3E%3Citem+id%3D%22attr%22%3E%3Citem+id%3D%22name%22%3E%3C%21%5BCDATA%5Bfriend%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22className%22%3E%3C%21%5BCDATA%5Bblock+move-span%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22titles%22%3E%3Citem+id%3D%220%22%3E%3Citem+id%3D%22text%22%3E%3C%21%5BCDATA%5B%E5%A5%BD%E5%8F%8B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22href%22%3E%3C%21%5BCDATA%5Bhttps%3A%2F%2Fwww.hostloc.com%2Fhome.php%3Fmod%3Dspace%26uid%3D27573%26do%3Dfriend%26view%3Dme%26from%3Dspace%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22color%22%3E%3C%21%5BCDATA%5B+%21important%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22float%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22margin%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22font-size%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22className%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22src%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3C%2Fitem%3E%3Citem+id%3D%22className%22%3E%3Citem+id%3D%220%22%3E%3C%21%5BCDATA%5Bblocktitle+title%5D%5D%3E%3C%2Fitem%3E%3C%2Fitem%3E%3Citem+id%3D%22style%22%3E%3C%2Fitem%3E%3C%2Fitem%3E%3C%2Fitem%3E%3C%2Fitem%3E%3Citem+id%3D%22block%60statistic%22%3E%3Citem+id%3D%22attr%22%3E%3Citem+id%3D%22name%22%3E%3C%21%5BCDATA%5Bstatistic%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22className%22%3E%3C%21%5BCDATA%5Bblock+move-span%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22titles%22%3E%3Citem+id%3D%220%22%3E%3Citem+id%3D%22text%22%3E%3C%21%5BCDATA%5B%E7%BB%9F%E8%AE%A1%E4%BF%A1%E6%81%AF%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22href%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22color%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22float%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22margin%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22font-size%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22className%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22src%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3C%2Fitem%3E%3Citem+id%3D%22className%22%3E%3Citem+id%3D%220%22%3E%3C%21%5BCDATA%5Bblocktitle+title%5D%5D%3E%3C%2Fitem%3E%3C%2Fitem%3E%3Citem+id%3D%22style%22%3E%3C%2Fitem%3E%3C%2Fitem%3E%3C%2Fitem%3E%3C%2Fitem%3E%3C%2Fitem%3E%3Citem+id%3D%22column%60frame1_center%22%3E%3Citem+id%3D%22attr%22%3E%3Citem+id%3D%22name%22%3E%3C%21%5BCDATA%5Bframe1_center%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22className%22%3E%3C%21%5BCDATA%5Bz+column%5D%5D%3E%3C%2Fitem%3E%3C%2Fitem%3E%3Citem+id%3D%22block%60thread%22%3E%3Citem+id%3D%22attr%22%3E%3Citem+id%3D%22name%22%3E%3C%21%5BCDATA%5Bthread%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22className%22%3E%3C%21%5BCDATA%5Bblock+move-span%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22titles%22%3E%3Citem+id%3D%220%22%3E%3Citem+id%3D%22text%22%3E%3C%21%5BCDATA%5B%E4%B8%BB%E9%A2%98%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22href%22%3E%3C%21%5BCDATA%5Bhttps%3A%2F%2Fwww.hostloc.com%2Fhome.php%3Fmod%3Dspace%26uid%3D27573%26do%3Dthread%26view%3Dme%26from%3Dspace%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22color%22%3E%3C%21%5BCDATA%5B+%21important%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22float%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22margin%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22font-size%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22className%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22src%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3C%2Fitem%3E%3Citem+id%3D%22className%22%3E%3Citem+id%3D%220%22%3E%3C%21%5BCDATA%5Bblocktitle+title%5D%5D%3E%3C%2Fitem%3E%3C%2Fitem%3E%3Citem+id%3D%22style%22%3E%3C%2Fitem%3E%3C%2Fitem%3E%3C%2Fitem%3E%3C%2Fitem%3E%3Citem+id%3D%22block%60visitor%22%3E%3Citem+id%3D%22attr%22%3E%3Citem+id%3D%22name%22%3E%3C%21%5BCDATA%5Bvisitor%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22className%22%3E%3C%21%5BCDATA%5Bblock+move-span%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22titles%22%3E%3Citem+id%3D%220%22%3E%3Citem+id%3D%22text%22%3E%3C%21%5BCDATA%5B%E6%84%9F%E8%B0%A2%E5%A4%A7%E5%AE%B6%E7%9A%84%E6%9D%A5%E8%AE%BF%7E%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22href%22%3E%3C%21%5BCDATA%5Bhttps%3A%2F%2Fwww.hostloc.com%2Fhome.php%3Fmod%3Dspace%26uid%3D27573%26do%3Dfriend%26view%3Dvisitor%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22color%22%3E%3C%21%5BCDATA%5B+%21important%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22float%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22margin%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22font-size%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22className%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3Citem+id%3D%22src%22%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C%2Fitem%3E%3C%2Fitem%3E%3Citem+id%3D%22className%22%3E%3Citem+id%3D%220%22%3E%3C%21%5BCDATA%5Bblocktitle+title%5D%5D%3E%3C%2Fitem%3E%3C%2Fitem%3E%3Citem+id%3D%22style%22%3E%3C%2Fitem%3E%3C%2Fitem%3E%3C%2Fitem%3E%3C%2Fitem%3E%3C%2Fitem%3E%3C%2Fitem%3E%3C%2Fitem%3E%3C%2Froot%3E¤tlayout=1%3A3&diysubmit=true","method":"POST","mode":"cors"});
2、在一个有回复评论框的帖子,F12 - Console - 粘贴 - 回车执行
3、然后他会弹出一个框,你再把css输入进那个框里面

代码一:

body:before {
content: close-quote;
width: 551px;
right: 10px;
top: 30px;
position: fixed;
background: center,url();
background-size: cover;
background-position: center;
height: 200px;
}

body {
background-image: url(https://api.ixiaowai.cn/api/api.php)!important;
background-size: cover;
background-attachment: fixed;
background-position: center;
}

#ct {
opacity: 0.8;
}

#hd {
visibility: hidden;
}

#ct:hover {
opacity: 0.95;
}

#ct {
opacity: 0.85;
transition: opacity 0.5s;
border-radius: 7px;
box-shadow: 0px 0px 20px 6px rgba(0,0,0,0.12),0px 0px 20px 6px rgba(0,0,0,0.12);
}

#ft {
visibility: hidden;
}

#pprl li {
padding: 3px 0 3px 0!important;
}

#pprl {
height: 120px;
padding-bottom:0!important;
}
.block .dxb_bc{
padding-bottom:0!important;
}

#pprl em {
display: none;
}

#pprl a {
font-size: 26px
}

.hm img {
border-radius: 50%;
margin-top: -110px;
box-shadow: 0px 0px 10px 6px rgba(0,0,0,0.12);
padding: 2px;
background: #FFF;
border: 1px solid;
border-color: #F2F2F2 #CDCDCD #CDCDCD #F2F2F2;
}

div#frame1_left {
overflow: visible;
}

.hm .mbn a {
visibility: hidden;
}

#profile .blocktitle span {
display: none;
}

#scrolltop {
display: none!important;
}

#toptb {
display: none!important;
}

.ct2 .sd {
overflow: visible;
}

.xs2 {
visibility: hidden;
}

#pprl:before {
content: close-quote;
width: 235px;
height: 70px;
display: block;
margin-left: -10px;
background-image: url(https://qwq.moe/img/mjj.svg);
}
.ul_list {
display: none;
}
#pprl li:nth-child(1) {
width: 210px;
color: #333;
text-align: center;
margin-top: -105px;
font-size:24px;
text-shadow: 1px 1px 20px rgba(33,33,33,0.3), 1px 1px 5px rgba(33,33,33,0.1);
}
#pprl li:nth-child(3){
margin-top:55px;
}

#pprl li:nth-child(2) {
display: none
}
html{
overflow: hidden;
}
body{
overflow: scroll;
height: 100vh;
overflow-x:hidden;
}
::-webkit-scrollbar {
width: 12px;
background-color: transparent;
}
::-webkit-scrollbar-thumb {
border-radius:12px;
background-color: rgba(0, 0, 0, 0.2);
width
transition: all 0.3s;
}
::-webkit-scrollbar-thumb:hover {
background-color: rgba(0, 0, 0, 0.4);
}
::-webkit-scrollbar-thumb:active {
background-color: rgba(0, 0, 0, 0.5);
}

.gol{
display:none;
}
#thread_content li a{
transition:margin 0.3s;
}
#thread_content li a:hover {
margin-left: 3px;
text-decoration: none;
}
.mls img{
border-radius:50%;
}
.hm img{
transition:transform 0.5s;
}
.hm img:hover{
transform:rotate(360deg);
}
.mls img{
transition:transform 0.5s;
}
.mls img:hover{
transform:rotate(-360deg);
}
#thread_content .xl li {
width: 50%;
}

#thread_content .xl {
display: flex;
flex-wrap: wrap;
}
#friend_content .ml {
display: flex;
justify-content: center;
}

#friend_content {
padding: 0;
}
#personalinfo_content p{
display:none;
}
#thread_content .xl{
display:flex;
flex-wrap:wrap;
}
#thread_content .xl li{
width:50%;
}
代码二:
html{
overflow: hidden;
}
body{
overflow: scroll;
height: 100vh;
overflow-x:hidden;
}
::-webkit-scrollbar {
width: 12px;
background-color: transparent;
}
::-webkit-scrollbar-thumb {
border-radius:12px;
background-color: rgba(0, 0, 0, 0.2);
width
transition: all 0.3s;
}
::-webkit-scrollbar-thumb:hover {
background-color: rgba(0, 0, 0, 0.4);
}
::-webkit-scrollbar-thumb:active {
background-color: rgba(0, 0, 0, 0.5);
}

.gol{
display:none;
}
代码三:随缘
body {background-attachment:scroll !important;}body {background-attachment:scroll !important;}body {background-attachment:scroll !important;}body{scrollbar-width: none;-ms-overflow-style: none;overflow-x: hidden;overflow-y: hidden;line-height:1;background-image:url(https://cdn.jsdelivr.net/gh/cy-j/chenyu/img/cysy2.png);background-size:512px;min-height:269px;background-position:50% 20%;background-repeat:no-repeat;background-color:#FFF;background-origin:content-box}#ct{visibility:hidden}#hd{visibility:hidden}#ft{visibility:hidden}#toptb{visibility:hidden}.scrolltopa{visibility:hidden}#scrolltop{visibility:hidden;display:none;}::-webkit-scrollbar{display: none;}
4、确定,然后到自己空间看效果

注:
测试discuz版本X3.4,其他版本自测。
仅测试了全球主机交流论坛,同版本discuz理论通用
未开通个人空间的论坛不可用
自定义css不建议过多且建议压缩成一行,以免导致失败

恢复
https://www.hostloc.com/home.php?mod=space&do=index&diy=yes
进入空间,在空间里点击恢复成默认排版