想问问有没有什么办法能够实现跨行展示,并且维持对应的标题缩进呢?
比如我这里的 h6 就没有展示完全
想问问有没有什么办法能够实现跨行展示,并且维持对应的标题缩进呢?
比如我这里的 h6 就没有展示完全
代码本身没有问题呀。
这个这个只能根据你自己的情况去调节了,你 line-height 也不要调太小了,太小了空间不够,肯定会挤的。
总之,当挤的时候,要么字体做够小,要么就只能扩大行高了,这是一个平衡,具体各多大合适,看个人喜好。
不用调 margin-top 和 margin-bottom,这个很容易让他们挤到一块,仅调字体和行高就够了。两者都调,掌握不好,很容易自己都搞不清楚哪里在哪里起作用了。
这是我按你的代码调整的,你可以参考下(这个例子以 H3 为例)
/* 仅限大纲 PC 版样式 */
.sy__outline {
.b3-list-item{
line-height:120%; /* 这里根据你自己的情况慢慢调整 */
}
.b3-list-item__text{
-webkit-line-clamp:inherit;
word-break:inherit;
overflow:inherit;
text-overflow:inherit;
word-wrap: break-word;
}
}
/* 一级标题 */
#sidebar [data-type="sidebar-outline"] ul.b3-list.b3-list--background [data-subtype="h3"], /* 手机端 H3 字符 */
.sy__outline ul.b3-list.b3-list--background [data-subtype="h3"], /* 电脑端 H3 字符 */
#sidebar [data-type="sidebar-outline"] ul.b3-list.b3-list--background [data-subtype="h3"] .b3-list-item__text,
.sy__outline ul.b3-list.b3-list--background [data-subtype="h3"] .b3-list-item__text, /* 电脑端 H3 标题 */
#sidebar [data-type="sidebar-outline"] ul.b3-list.b3-list--background [data-subtype="h3"] .b3-list-item__toggle,
.sy__outline ul.b3-list.b3-list--background [data-subtype="h3"] .b3-list-item__toggle { /* 电脑端 H3 前的箭头 */
color: var(--custom-h1-color);
font-size: 12px; /* 修改左侧大纲字体大小 */
padding-top: 2px; /* 标题内部顶部的空间 */
padding-bottom: 2px; /* 标题内部底部的空间 */
}
.b3-list-item{
line-height:160%;
}
.b3-list-item__text{
word-wrap: break-word;
-webkit-line-clamp:inherit;
word-break:inherit;
overflow:inherit;
text-overflow:inherit;
}
同时支持文档树和大纲,如果限制手机版就加 .b3-list--mobile
前缀
如果仅限文档树,pc 版就用就用 .sy__file
前缀,手机版就用 [data-type="sidebar-file"]
如果仅限大纲就用 .sy__outline
前缀,手机版就用 [data-type="sidebar-outline"]
佬我修改了一下代码如下,可以使用了。但是有一个问题,就是图片显示,如果一行还好,但是前后两个都要缩的话,就会叠在一起。我之前对大纲做过修改,代码块在图片下面附上。你可以看看有改进空间吗?(因为我希望同样版面尽可能显示更多的大纲标题行,所以改得比较紧凑。我看着这个问题好像是无解了,但是还是想问问你,或许有办法)
/* 仅限大纲 PC 版样式 */
.sy__outline {
.b3-list-item{
line-height:100%; /* 90%都窄了 */
}
.b3-list-item__text{
-webkit-line-clamp:inherit;
word-break:inherit;
overflow:inherit;
text-overflow:inherit;
}
}
.b3-list-item {
font-size: 12px ; /* 修改大纲列表项的字体大小 */
margin-top: -7px ; /* 修改上方的外边距 */
margin-bottom: -7px ; /* 修改下方的外边距 */
}
那个大纲修改的代码没弄全,下面是一级标题示例,我对 1-6 级标题都做了一样的修改。
/* 一级标题 */ #sidebar [data-type="sidebar-outline"] ul.b3-list.b3-list--background [data-subtype="h1"], /* 手机端 H1 字符 */ .sy__outline ul.b3-list.b3-list--background [data-subtype="h1"], /* 电脑端 H1 字符 */ #sidebar [data-type="sidebar-outline"] ul.b3-list.b3-list--background [data-subtype="h1"] .b3-list-item__text, .sy__outline ul.b3-list.b3-list--background [data-subtype="h1"] .b3-list-item__text, /* 电脑端 H1 标题 */ #sidebar [data-type="sidebar-outline"] ul.b3-list.b3-list--background [data-subtype="h1"] .b3-list-item__toggle, .sy__outline ul.b3-list.b3-list--background [data-subtype="h1"] .b3-list-item__toggle { /* 电脑端 H1 前的箭头 */ color: var(--custom-h1-color); font-size: 12px; /* 修改左侧大纲字体大小 */ padding-top: 0px; /* 标题内部顶部的空间 */ padding-bottom: 0px; /* 标题内部底部的空间 */ margin-top: -10px; /* 调整上方的外边距 */ /* 负值 margin 可以调整元素位置 */ margin-bottom: -10px; /* 调整下方的外边距 */ }
代码本身没有问题呀。
这个这个只能根据你自己的情况去调节了,你 line-height 也不要调太小了,太小了空间不够,肯定会挤的。
总之,当挤的时候,要么字体做够小,要么就只能扩大行高了,这是一个平衡,具体各多大合适,看个人喜好。
不用调 margin-top 和 margin-bottom,这个很容易让他们挤到一块,仅调字体和行高就够了。两者都调,掌握不好,很容易自己都搞不清楚哪里在哪里起作用了。
这是我按你的代码调整的,你可以参考下(这个例子以 H3 为例)
/* 仅限大纲 PC 版样式 */
.sy__outline {
.b3-list-item{
line-height:120%; /* 这里根据你自己的情况慢慢调整 */
}
.b3-list-item__text{
-webkit-line-clamp:inherit;
word-break:inherit;
overflow:inherit;
text-overflow:inherit;
word-wrap: break-word;
}
}
/* 一级标题 */
#sidebar [data-type="sidebar-outline"] ul.b3-list.b3-list--background [data-subtype="h3"], /* 手机端 H3 字符 */
.sy__outline ul.b3-list.b3-list--background [data-subtype="h3"], /* 电脑端 H3 字符 */
#sidebar [data-type="sidebar-outline"] ul.b3-list.b3-list--background [data-subtype="h3"] .b3-list-item__text,
.sy__outline ul.b3-list.b3-list--background [data-subtype="h3"] .b3-list-item__text, /* 电脑端 H3 标题 */
#sidebar [data-type="sidebar-outline"] ul.b3-list.b3-list--background [data-subtype="h3"] .b3-list-item__toggle,
.sy__outline ul.b3-list.b3-list--background [data-subtype="h3"] .b3-list-item__toggle { /* 电脑端 H3 前的箭头 */
color: var(--custom-h1-color);
font-size: 12px; /* 修改左侧大纲字体大小 */
padding-top: 2px; /* 标题内部顶部的空间 */
padding-bottom: 2px; /* 标题内部底部的空间 */
}
.protyle-hint:not(.fn__none) button[data-value^="%3Cspan%20data-type%3D%22tag%22%3E"] .b3-list-item__text {
-webkit-line-clamp:inherit;
word-break:inherit;
overflow:inherit;
text-overflow:inherit;
word-wrap: break-word;
line-height: 20px; /* 行高,官方默认是28px,可根据自己需要调整 */
}
Hadoop 是由 Apache 基金会所开发的一个分布式系统基础架构。用户可以在不了解分布式底层细节的情况下,开发分布式程序。充分利用集群的威力进行高速运算和存储。
房星网,我们不和没有钱的程序员谈理想,我们要让程序员又有理想又有钱。我们有雄厚的房地产行业线下资源,遍布昆明全城的 100 家门店、四千地产经纪人是我们坚实的后盾。
Ant Design 是服务于企业级产品的设计体系,基于确定和自然的设计价值观上的模块化解决方案,让设计者和开发者专注于更好的用户体验。
iOS 是由苹果公司开发的移动操作系统,最早于 2007 年 1 月 9 日的 Macworld 大会上公布这个系统,最初是设计给 iPhone 使用的,后来陆续套用到 iPod touch、iPad 以及 Apple TV 等产品上。iOS 与苹果的 Mac OS X 操作系统一样,属于类 Unix 的商业操作系统。
CSS(Cascading Style Sheet)“层叠样式表”是用于控制网页样式并允许将样式信息与网页内容分离的一种标记性语言。
NGINX 是一个高性能的 HTTP 和反向代理服务器,也是一个 IMAP/POP3/SMTP 代理服务器。 NGINX 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,第一个公开版本 0.1.0 发布于 2004 年 10 月 4 日。
汐洛彖夲肜矩阵(Sillot T☳Converbenk Matrix),致力于服务智慧新彖乄,具有彖乄驱动、极致优雅、开发者友好的特点。其中汐洛绞架(Sillot-Gibbet)基于自思源笔记(siyuan-note),前身是思源笔记汐洛版(更早是思源笔记汐洛分支),是智慧新录乄终端(多端融合,移动端优先)。
主仓库地址:Hi-Windom/Sillot
文档地址:sillot.db.sc.cn
注意事项:
你若安好,便是晴天。
一些有用的避坑指南。
C 语言是一门通用计算机编程语言,应用广泛。C 语言的设计目标是提供一种能以简易的方式编译、处理低级存储器、产生少量的机器码以及不需要任何运行环境支持便能运行的编程语言。
CAP 指的是在一个分布式系统中, Consistency(一致性)、 Availability(可用性)、Partition tolerance(分区容错性),三者不可兼得。
Vim 是类 UNIX 系统文本编辑器 Vi 的加强版本,加入了更多特性来帮助编辑源代码。Vim 的部分增强功能包括文件比较(vimdiff)、语法高亮、全面的帮助系统、本地脚本(Vimscript)和便于选择的可视化模式。
京东是中国最大的自营式电商企业,2015 年第一季度在中国自营式 B2C 电商市场的占有率为 56.3%。2014 年 5 月,京东在美国纳斯达克证券交易所正式挂牌上市(股票代码:JD),是中国第一个成功赴美上市的大型综合型电商平台,与腾讯、百度等中国互联网巨头共同跻身全球前十大互联网公司排行榜。
面试造航母,上班拧螺丝。多面试,少加班。
WebSocket 是 HTML5 中定义的一种新协议,它实现了浏览器与服务器之间的全双工通信(full-duplex)。
单点登录(Single Sign On)是目前比较流行的企业业务整合的解决方案之一。SSO 的定义是在多个应用系统中,用户只需要登录一次就可以访问所有相互信任的应用系统。
Swift 是苹果于 2014 年 WWDC(苹果开发者大会)发布的开发语言,可与 Objective-C 共同运行于 Mac OS 和 iOS 平台,用于搭建基于苹果平台的应用程序。
TextBundle 文件格式旨在应用程序之间交换 Markdown 或 Fountain 之类的纯文本文件时,提供更无缝的用户体验。
Solidity 是一种智能合约高级语言,运行在 [以太坊] 虚拟机(EVM)之上。它的语法接近于 JavaScript,是一种面向对象的语言。
Logseq 是一个隐私优先、开源的知识库工具。
Logseq is a joyful, open-source outliner that works on top of local plain-text Markdown and Org-mode files. Use it to write, organize and share your thoughts, keep your to-do list, and build your own digital garden.
Web Components 是 W3C 定义的标准,它给了前端开发者扩展浏览器标签的能力,可以方便地定制可复用组件,更好的进行模块化开发,解放了前端开发者的生产力。
大数据(big data)是指无法在一定时间范围内用常规软件工具进行捕捉、管理和处理的数据集合,是需要新处理模式才能具有更强的决策力、洞察发现力和流程优化能力的海量、高增长率和多样化的信息资产。
程序员是从事程序开发、程序维护的专业人员。
心是产生任何想法的源泉,心本体会陷入到对自己本体不能理解的状态中,因为心能产生任何想法,不能分出对错,不能分出自己。