首页 > 其他分享 >博客园自定义页面样式

博客园自定义页面样式

时间:2024-10-27 17:03:32浏览次数:1  
标签:flex 自定义 17 博客园 238 font margin display 页面

The First to Say

花了两天,重写了博客的页面样式。整体风格是按照_darkgreentrip_的风格去改的,使之更接近苯人的风格。

最后在结尾放了一些格子可以用来导航,有好用的网站大概会放在这里。

自己其实有做过导航站,但是由于挂在GitHub上,网速比较慢,现在扔在下面平时也稍微能用用()

下面贴上源码,想用的可以参考下。

(bug可能很多,欢迎下方留言 //感谢感谢//)

源码

CSS样式,记得禁用默认样式

点击查看代码
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: #eee;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    opacity: 1.0;
    transition: all .5s;
}

a:hover {
    opacity: .6;
}

code,
img {
    border-radius: 5px;
}

body {
    background-color: #111;
    background-image: url(https://pic.imge.cc/2024/09/11/66e11b6870ab2.jpg);
    background-repeat: no-repeat;
    /* background-position: center; */
    background-attachment: fixed;
    background-size: cover;
    height: 100%;
    width: 100%;
    -webkit-transform-style: preserve-3d;
    /* Safari */
    transform-style: preserve-3d;
}

#top_nav,
#cnblogs_ch,
#opt_under_post,
#under_post_card1,
#under_post_card2,
#HistoryToday,
#vip_tip,
#commentform_title,
#tip_comment,
#tip_comment2,
#tip_comment2+p,
#lnkBlogLogo,
#sidebar_search,
.clear,
.pager,
#comment_pager_top+br,
#green_channel,
#footer,
.diggword {
    display: none;
}

#home {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background-color: rgba(17, 17, 17, 0.67);
}

#header {
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-start;
    user-select: none;
}

#blogTitle {
    margin-bottom: 40px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    height: 80px;
    background-color: rgba(238, 238, 238, 0.18);
    box-shadow: 0 0 8px rgba(17, 17, 17, 0.67);
}

#blogTitle h1,
#blogTitle h2 {
    margin-left: 30px;
}

#navigator {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    height: 50px;
    background-color: rgba(17, 17, 17, 0.87);
    backdrop-filter: blur(5px);
    position: sticky;
    top: 0;
}

#navList {
    min-width: 300px;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
}

#navList li {
    flex-grow: 0;
    padding-left: 20px;
    font-size: 18px;
    font-weight: lighter;
}

.blogStats {
    margin-right: 20px;
    font-weight: lighter;
}

#main {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    align-items: flex-start;
}

#mainContent {
    width: 60%;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
}

#sideBar {
    width: 20%;
    margin-top: 40px;
    position: sticky;
    top: 0;
    z-index: 0;
}

.newsItem,
.sidebar-block {
    margin: 20px;
    padding: 15px;
    color: #333;
    /* 明确色彩,增加可读性 */
    overflow: hidden;
    word-break: break-word;
    background: rgba(238, 238, 238, 0.18);
    border-radius: 15px;
    box-shadow: 2px 2px 8px rgba(17, 17, 17, 0.4);
    transition: all .5s;
}

.newsItem:hover,
.sidebar-block:hover{
    background-color: rgba(238, 238, 238, 0.22);
}

#profile_block,
.newsItem ul,
.sidebar-block ul {
    margin-top: 10px;
    margin-left: 5px;
    line-height: 1.8;
    text-align: left;
}

#myposts {
    margin-left: 0;
}

.forFlow {
    width: 100%;
}

.day,
#myposts .PostList,
.entrylistItem {
    margin: 20px;
    padding: 15px;
    overflow: hidden;
    word-break: break-word;
    background: rgba(51, 51, 51, 0.8);
    border-radius: 15px;
    box-shadow: 2px 2px 8px rgba(17, 17, 17, 0.4);
    transition: all .5s;
}

.day:hover,
#myposts .PostList:hover,
.entrylistItem:hover{
    background-color: rgba(238, 238, 238, 0.22);
}

.dayTitle {
    margin-bottom: 5px;
    font-size: 22px;
    font-weight: bold;
    line-height: 1.8;
    text-decoration: underline;
}

.entrylistItemTitle,
.postTitl2,
.postTitle {
    margin-bottom: 5px;
    font-size: 20px;
    font-weight: bold;
    line-height: 1.8;
}

.feedback_area_title {
    font-weight: bold;
    font-size: 18px;
}

.post .postTitle {
    display: block;
    margin: 0;
    font-size: 32px;
    font-weight: bold;
    line-height: 1.6;
}

.entrylistPostSummary {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.c_b_p_desc,
.postCon {
    margin-top: 5px;
    margin-left: 5px;
    font-size: 16px;
    font-weight: normal;
    line-height: 1.6;
}

.c_b_p_desc a {
    padding-left: 20px;
}

.entrylistItemPostDesc,
.postDesc,
.postDesc2 {
    font-size: 12px;
    font-weight: lighter;
    margin: 20px 5px 5px;
    text-align: right;
}

.postBody {
    margin: 10px;
    padding: 10px;
    overflow: hidden;
    word-break: break-word;
    background: #333;
    border-radius: 15px;
    box-shadow: 2px 2px 8px rgba(17, 17, 17, 0.4);
    opacity: 0.8;
    transition: all .5s;
}

.postBody:hover{
    opacity: 0.9;
}

#blog-comments-placeholder,
.commentform {
    margin: 20px 10px;
    padding: 15px;
    overflow: hidden;
    word-break: break-word;
    background: rgba(238, 238, 238, 0.18);
    border-radius: 15px;
    box-shadow: 2px 2px 8px rgba(17, 17, 17, 0.4);
    transition: all .5s;
}

#blog-comments-placeholder:hover,
.commentform:hover {
    background: rgba(238, 238, 238, 0.22)
}

#comment_sort {
    display: flex;
    align-items: center;
}

blockquote{
    border: solid white thin;
    border-radius: 5px;
}

.feedbackItem {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    margin: 10px 0 0;
    padding: 15px;
    overflow: hidden;
    word-break: break-word;
    background: rgba(238, 238, 238, 0.18);
    border-radius: 10px;
    box-shadow: 1px 1px 5px rgba(17, 17, 17, 0.4);
    transition: all .5s;
}

.feedbackItem:hover {
    background: rgba(238, 238, 238, 0.22)
}



.feedbackListSubtitle {
    display: flex;
    flex-direction: row;
    font-size: 12px;
    font-weight: lighter;
    margin: 5px 0;
    text-align: left;
}

.layer,
.feedbackManage,
.comment_date,
.feedbackManage span+a {
    margin: 0 5px;
}

.feedbackCon {
    width: 100%;
    padding-left: 15px;
}

.comment_vote {
    text-align: right;
    font-size: 12px;
    font-weight: lighter;
    margin: 5px 0;
}

#comment_nav {
    text-align: right;
    font-size: 12px;
    font-weight: lighter;
    margin: 5px 0 15px;
}

.commentbox_main.comment_textarea {
    width: 100%;
    border-radius: 10px;
    border: 0;
    box-shadow: 1px 1px 5px rgba(17, 17, 17, 0.4);
    background-color: rgba(238, 238, 238, 0.18);
    transition: all .5s;
}

.commentbox_main.comment_textarea:hover {
    background-color: rgba(238, 238, 238, 0.22);
}

.commentbox_title {
    transition: all .5s;
}

#tbCommentBody {
    min-height: 50px;
    color: #333;
    font-size: 16px;
    background-color: transparent;
    /* 明确指定透明 */
}

.inline_middle {
    color: #333;
    font-size: 12px;
    font-weight: normal;
}

#commentbox_opt {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
}

#commentbox_opt input,
#commentbox_opt a {
    margin: 0 10px;
    display: block;
}

.comment_btn {
    background-color: #333333;
    border-radius: 5px;
    border: 0;
    opacity: .8;
    transition: all .5s;
}

.comment_btn:hover {
    opacity: .6;
}

.bq_post_comment {
    border-radius: 10px;
}

#blog_post_info_block{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#blog_post_info{
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

#BlogCollection{
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: start;
    align-items: center;
}

#author_profile{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin: 0;
}

#author_profile_info{
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

#author_profile_info img{
    margin: 0;
    padding: 0;
    border-radius: 10px;
}

#author_profile_info a{
    margin: 10px;
}

#div_digg{
    width: 120px;
    height: 40px;
    background-color: rgba(238, 238, 238, 0.18);
    border-radius: 10px;
    display: flex;
    margin: 0 10px;
    justify-content: space-evenly;
    align-items: center;
}

.diggit,
.buryit{
    margin: 0;
    padding: 0;
    height: 30px;
    border-radius: 6px;
    background-image: url(#);
    background-color: rgba(238, 238, 238, 0.1);
    box-shadow: 1px 1px 5px rgba(17, 17, 17, 0.4);

    display: flex;
    justify-content: center;
    align-items: center;

    transition: all .5s;
}

.diggit:hover,
.buryit:hover{
    background-color: rgba(238, 238, 238, 0.22);
}

.buryit{
    width: 50px;
}

.buryit:hover span::after{
    content: " Dns";
}

.diggit{
    width: 50px;
}

.diggit:hover span::after{
    content: " Ups";
}

.diggnum,
.burynum{
    color: #eee;
    font-size: 14px;
    font-weight: normal;
}

#post_next_prev{
    margin-top: 20px;
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: start;
    align-items: center;
    border: solid thin rgba(238, 238, 238, 0.22);
    background-color: rgba(238, 238, 238, 0.22);
    box-shadow: rgba(17, 17, 17, 0.4);
    border-radius: 10px;
}

#post_next_prev>a{
    margin-left: 8%;
}

.cnblogs-toc-content,
.cnblogs-toc-item,
.cnblogs-toc-title>div{
    color: #333;
}

/*此后为页尾css*/

.testplace {
    /* padding: 20px; */
    display: flex;
    justify-content: center;
    align-items: center;
}

#body {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: start;
    background-color: rgba(17, 17, 17, 0.67);
}

.endfoot{
    width: 100%;
    height: 350px;
    padding: 40px 10%;
    margin-top: 50px;
    display: flex;
    align-items: start;
    justify-content: space-evenly;
}

.frilinks {
    padding-left: 15px;
    margin-right: 10px;
    display: flex;
    flex-direction: column;
    align-items: start;
    width: 200px;
    height: auto;
}

.contactus {
    padding-left: 15px;
    margin-right: 10px;
    display: flex;
    flex-direction: column;
    align-items: start;
    width: 200px;
    height: auto;
}


.footertext {
    padding-left: 15px;
    display: flex;
    flex-direction: column;
    align-items: start;
    width: 400px;
    height: auto;
}

.endfoot h4 {
    color: #e5e5e560;
    font-weight: 500;
}

.endfoot p,
.endfoot a {
    display: flex;
    flex-direction: row;
    justify-content: start;
    font-family: Helvetica, sans-serif;
    font-size: 14px;
    line-height: 20px;
    text-indent: 0px;
    color: #ffffff1f;
    font-weight: 300;
    margin: 10px 0 0 5px;
    text-decoration: none;
    transition: all .5s;
}

.endfoot a:hover {
    color: #FFFFFF6F;
}

除了card的末尾HTML,放在页尾代码里,要自己改信息

点击查看代码

<div class="testplace">
    <div id="body">
        <div class="endfoot">
            <div class="frilinks">
                <h4>友链</h4>
                <a href="#" target="_blank">欢迎联系1</a>
                <a href="#" target="_blank">欢迎联系2</a>
                <a href="#" target="_blank">欢迎联系3</a>
                <a href="#" target="_blank">欢迎联系4</a>
            </div>
            <div class="contactus">
                <h4>联系</h4>
                <a href="#" target="_blank">链接</a>
                <p>非链接</p>
            </div>
            <div class="footertext">
                <h4>© 2021-2024 YourName</h4>
                <p>Copyright &copy; 2024 #</p>
                <p>Powered by .NET 8.0 on Kubernetes</p>
            </div>
        </div>
    </div>
</div>

已知BUG

  • 无法正常放大查看代码
  • 移动端未适配
    • 这个原因是媒体查询选择器未生效,推测是博客园根样式覆盖了
  • 评论补充

标签:flex,自定义,17,博客园,238,font,margin,display,页面
From: https://www.cnblogs.com/churk/p/18508581

相关文章

  • 微服务网关gateway过滤器工厂与自定义过滤器
    gateway过滤器工厂与自定义过滤器过滤器工厂GatewayFilter是网关中提供的一种过滤器,可以对进入网关的请求和微服务返回的响应做处理:1.路由过滤器的种类Spring提供了31种不同的路由过滤器工厂。例如:名称说明AddRequestHeader给当前请求添加一个请求头RemoveRequestHead......
  • 有趣的html页面
    有趣的html页面No1<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><metaname="viewport"content="width=device-width,initial-scale=1.0"><title>Document<......
  • 在VUE框架下使用vue-router来进行局部页面跳转
    在VUE框架下使用vue-router来进行局部页面跳转1、创建并绑定路由文件2、在Vue文件下,使用路由来进行跳转步骤如下:1、创建并绑定路由文件①创建路由文件在路径"./{prjName}/src/router"下创建router.ts文件import{createRouter,createWebHistory,createWebHashHistory}......
  • kube-prometheus-stack 自定义 alertmanager 配置推送webhook
    创建AlertmanagerConfig资源在没有使用prometheus-operator的情况下,需要手动配置alertmanager.yaml来路由&发送从prometheus接收的警报。使用prometheus-operator之后,事情变得简单一些。只需要创建AlertmanagerConfig资源,prometheus-operator会自动merge所有的Ale......
  • 化学仿真软件:Aspen Plus二次开发_自定义模型开发
    自定义模型开发1.介绍AspenPlus是一种广泛应用于化工过程模拟和优化的软件工具。在许多情况下,标准模型库中的模型可能无法满足特定工艺的需求。因此,自定义模型开发成为提高仿真精度和效率的重要手段。本节将详细介绍如何在AspenPlus中开发自定义模型,包括模型开发的......
  • 第7章 利用CSS和多媒体美化页面作业
    1.利用CSS技术,结合表格和列表,制作并美化“翡翠阁”页面。浏览效果如下:HTML代码如下:<!DOCTYPEhtml><html> <head> <metacharset="utf-8"> <title>翡翠阁</title> <linkrel="stylesheet"href="css/243_1.css"type="t......
  • 学习笔记(五):自定义构建函数
    若自定义的组件内部UI结构固定,且仅与使用方进行数据传递。则无需单独写一个自定义组件文件,可直接在使用方内进行定义。即UI元素复用机制@Builder,@Builder所装饰的函数遵循build()函数语法规则,开发者可以将重复使用的UI元素抽象成一个方法,在build方法里调用。定义一个自定义构建......
  • WPF+Mvvm案例实战(五)- 自定义雷达图实现
    文章目录1、项目准备1、创建文件2、用户控件库2、功能实现1、用户控件库1、控件样式实现2、数据模型实现2、应用程序代码实现1.UI层代码实现2、数据后台代码实现3、主界面菜单添加1、后台按钮方法改造:2、按钮添加:3、依赖注入3、运行效果4、源代码获取1、项目准......
  • WPF+MVVM案例实战(六)- 自定义分页控件实现
    文章目录1、项目准备2、功能实现1、分页控件DataPager实现2、分页控件数据模型与查询行为3、数据界面实现3、运行效果4、源代码获取1、项目准备打开项目Wpf_Examples,新建PageBarWindow.xaml界面、PageBarViewModel.cs,在用户控件库UserControlLib中创建用......
  • swiftui之覆盖、跳转页面
    Color.black.edgesIgnoringSafeArea(.all):创建一个黑色背景,并扩展至安全区域外。importSwiftUIstructJumpView:View{@StatevarshowHome=falsevarbody:someView{ZStack{Color.black.edgesIgnoringSafeArea(.all)......