• typora的主题文件相关(与图片显示有关)


    typora的主题文件相关

    1.这是收藏的主题文件,定义了标题,代码块,文字块等等(个人使用的)。

    /* 全局属性 */
    #write {
      margin: 0 auto;
      padding: 1rem 4rem;
      font-size: 18px;
      color: black;
      line-height: 1.6;
      word-spacing: 0px;
      letter-spacing: 0px;
      word-break: break-word;
      word-wrap: break-word;
      text-align: left;
      font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    }
    
    /*段落*/
    #write p {
      font-size: 16px;
      padding-top: 8px;
      padding-bottom: 8px;
      margin: 0;
      line-height: 26px;
      color: black;
    }
    
    
    /*标题*/
    #write h1,
    #write h2,
    #write h3,
    #write h4,
    #write h5,
    #write h6 {
      margin-top: 30px;
      margin-bottom: 15px;
      padding: 0px;
      font-weight: bold;
      color: black;
    }
    
    #write h1 {
      text-align: center;
      margin-bottom: 2rem;
      line-height: 1.5;
    }
    
    #write h1:after {
      content: "";
      display: block;
      margin: 0.2rem auto 0;
      width: 6rem;
      height: 2px;
      border-bottom: 2px solid var(--title-color);
    }
    
    #write h2 {
      font-size: 1.3rem;
      border-bottom: 2px solid rgb(239, 112, 96);
    }
    
    #write h2 span {
      display: inline-block;
      font-weight: bold;
      background: rgb(239, 112, 96);
      color: #ffffff;
      padding: 3px 10px 1px;
      border-top-right-radius: 3px;
      border-top-left-radius: 3px;
      margin-right: 3px;
    }
    
    #write h2:after {
      display: inline-block;
      content: "";
      vertical-align: bottom;
      border-bottom: 36px solid #efebe9;
      border-right: 20px solid transparent;
    }
    
    #write h3 {
      font-size: 1.2rem;
    }
    
    #write h3 span {
      display: inline-block;
      font-weight: bold;
      background: rgb(141, 247, 127);
      color: #332e2d;
      padding: 3px 10px 1px;
      border-top-right-radius: 3px;
      border-top-left-radius: 3px;
      margin-right: 3px;
    }
    
    #write h2:after {
      display: inline-block;
      content: "";
      vertical-align: bottom;
      border-bottom: 36px solid #efebe9;
      border-right: 20px solid transparent;
    }
    
    #write h4 {
      font-size: 1.1rem;
    }
    
    #write h5 {
      font-size: 1rem;
    }
    
    #write h6 {
      font-size: 1rem;
    }
    
    /*列表*/
    #write ul,
    #write ol {
      margin-top: 8px;
      margin-bottom: 8px;
      padding-left: 25px;
      color: black;
    }
    
    #write ul {
      list-style-type: disc;
    }
    
    #write ul ul {
      list-style-type: square;
    }
    
    #write ol {
      list-style-type: decimal;
    }
    
    #write li section {
      margin-top: 5px;
      margin-bottom: 5px;
      line-height: 26px;
      text-align: left;
      color: rgb(1, 1, 1);
      /* 只要是纯黑色微信编辑器就会把color这个属性吞掉。。。*/
      font-weight: 500;
    }
    
    /*引用*/
    #write blockquote {
      display: block;
      font-size: 0.9em;
      overflow: auto;
      overflow-scrolling: touch;
      border-left: 3px solid rgb(239, 112, 96);
      color: #6a737d;
      padding: 10px 10px 10px 20px;
      margin-bottom: 20px;
      margin-top: 20px;
      background: #fff9f9;
    }
    
    #write blockquote p {
      margin: 0px;
      color: black;
      line-height: 26px;
    }
    
    /*链接*/
    #write a {
      text-decoration: none;
      word-wrap: break-word;
      font-weight: bold;
      border-bottom: 1px solid #1e6bb8;
      color: rgb(239, 112, 96);
      border-bottom: 1px solid rgb(239, 112, 96);
    }
    
    /*行内代码*/
    #write p code,
    #write li code {
      font-size: 14px;
      word-wrap: break-word;
      padding: 2px 4px;
      border-radius: 4px;
      margin: 0 2px;
      color: rgb(239, 112, 96);
      ;
      background-color: rgba(27, 31, 35, .05);
      font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;
      word-break: break-all;
    }
    
    /*图片*/
    #write span img {
      display: block;
      margin: 0 auto;
      max-width: 100%;
    }
    
    
    /*表格*/
    #write table {
      display: table;
      text-align: left;
    }
    
    #write tbody {
      border: 0;
    }
    
    #write table tr {
      border: 0;
      border-top: 1px solid #ccc;
      background-color: white;
    }
    
    #write table tr:nth-child(2n) {
      background-color: #F8F8F8;
    }
    
    #write table tr th,
    #write table tr td {
      font-size: 16px;
      border: 1px solid #ccc;
      padding: 5px 10px;
      text-align: left;
    }
    
    #write table tr th {
      font-weight: bold;
      background-color: #f0f0f0;
    }
    
    /* 行内代码 */
    #write span code,
    #write li code {
      color: rgb(239, 112, 96);
    }
    
    /* 脚注上标 */
    #write .md-footnote {
      font-weight: bold;
      color: rgb(239, 112, 96);
    }
    
    #write .md-footnote>.md-text:before {
      content: '['
    }
    
    #write .md-footnote>.md-text:after {
      content: ']'
    }
    
    /* 脚注 */
    #write .md-def-name {
      padding-right: 1.8ch;
    }
    
    #write .md-def-name:before {
      content: '[';
      color: #000;
    }
    
    #write .md-def-name:after {
      color: #000;
    }
    
    /* 代码块主题 */
    .md-fences:before {
      content: ' ';
      display: block;
      width: 100%;
      background-size: 40px;
      background-repeat: no-repeat;
      background-color: #282c34;
      margin-bottom: -7px;
      border-radius: 5px;
      background-position: 10px 10px;
    }
    
    .cm-s-inner.CodeMirror {
      padding-top: .5rem;
      padding-bottom: .5rem;
      background-color: #292d3e;
      color: #fafafd;
      font-family: Consolas;
      border-radius: 4px;
    }
    
    .CodeMirror-lines {
      padding-left: 4px;
    }
    
    .cm-s-inner .cm-keyword {
      color: #c792ea !important;
    }
    
    .cm-s-inner .cm-operator {
      color: #89ddff !important;
    }
    
    .cm-s-inner .cm-variable-2 {
      color: #eeffff !important;
    }
    
    .cm-s-inner .cm-variable-3,
    .cm-s-inner .cm-type {
      color: #f07178 !important;
    }
    
    .cm-s-inner .cm-builtin {
      color: #ffcb6b !important;
    }
    
    .cm-s-inner .cm-atom {
      color: #f78c6c !important;
    }
    
    .cm-s-inner .cm-number {
      color: #ff5370 !important;
    }
    
    .cm-s-inner .cm-def {
      color: #82aaff !important;
    }
    
    .cm-s-inner .cm-string {
      color: #c3e88d !important;
    }
    
    .cm-s-inner .cm-string-2 {
      color: #f07178 !important;
    }
    
    .cm-s-inner .cm-comment {
      color: #f3b50a !important;
    }
    
    .cm-s-inner .cm-variable {
      color: #f07178 !important;
    }
    
    .cm-s-inner .cm-tag {
      color: #ff5370 !important;
    }
    
    .cm-s-inner .cm-meta {
      color: #ffcb6b !important;
    }
    
    .cm-s-inner .cm-attribute {
      color: #c792ea !important;
    }
    
    .cm-s-inner .cm-property {
      color: #c792ea !important;
    }
    
    .cm-s-inner .cm-qualifier {
      color: #decb6b !important;
    }
    
    .cm-s-inner .cm-variable-3,
    .cm-s-inner .cm-type {
      color: #decb6b !important;
    }
    
    .cm-s-inner .cm-error {
      color: rgba(255, 255, 255, 1) !important;
      background-color: #ff5370 !important;
    }
    
    .cm-s-inner .CodeMirror-matchingbracket {
      text-decoration: underline;
      color: white !important;
    }
    
    .CodeMirror div.CodeMirror-cursor {
      border-left: 1px solid rgb(239, 112, 96);
      z-index: 3;
    }
    
    .cm-s-inner div.CodeMirror-selected {
      background: rgba(167, 178, 189, 0.2) !important;
    }
    
    .cm-s-inner.CodeMirror-focused div.CodeMirror-selected {
      background: rgba(167, 178, 189, 0.2) !important;
    }
    
    .cm-s-inner .CodeMirror-selected,
    .cm-s-inner .CodeMirror-selectedtext {
      background-color: rgba(167, 178, 189, 0.0) !important;
    }
    
    .cm-s-inner .CodeMirror-line::-moz-selection,
    .cm-s-inner .CodeMirror-line>span::-moz-selection,
    .cm-s-inner .CodeMirror-line>span>span::-moz-selection {
      background-color: rgba(167, 178, 189, 0.2);
    }
    
    .cm-s-inner .CodeMirror-line::selection,
    .cm-s-inner .CodeMirror-line>span::selection,
    .cm-s-inner .CodeMirror-line>span>span::selection {
      background-color: rgba(167, 178, 189, 0.2);
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    • 171
    • 172
    • 173
    • 174
    • 175
    • 176
    • 177
    • 178
    • 179
    • 180
    • 181
    • 182
    • 183
    • 184
    • 185
    • 186
    • 187
    • 188
    • 189
    • 190
    • 191
    • 192
    • 193
    • 194
    • 195
    • 196
    • 197
    • 198
    • 199
    • 200
    • 201
    • 202
    • 203
    • 204
    • 205
    • 206
    • 207
    • 208
    • 209
    • 210
    • 211
    • 212
    • 213
    • 214
    • 215
    • 216
    • 217
    • 218
    • 219
    • 220
    • 221
    • 222
    • 223
    • 224
    • 225
    • 226
    • 227
    • 228
    • 229
    • 230
    • 231
    • 232
    • 233
    • 234
    • 235
    • 236
    • 237
    • 238
    • 239
    • 240
    • 241
    • 242
    • 243
    • 244
    • 245
    • 246
    • 247
    • 248
    • 249
    • 250
    • 251
    • 252
    • 253
    • 254
    • 255
    • 256
    • 257
    • 258
    • 259
    • 260
    • 261
    • 262
    • 263
    • 264
    • 265
    • 266
    • 267
    • 268
    • 269
    • 270
    • 271
    • 272
    • 273
    • 274
    • 275
    • 276
    • 277
    • 278
    • 279
    • 280
    • 281
    • 282
    • 283
    • 284
    • 285
    • 286
    • 287
    • 288
    • 289
    • 290
    • 291
    • 292
    • 293
    • 294
    • 295
    • 296
    • 297
    • 298
    • 299
    • 300
    • 301
    • 302
    • 303
    • 304
    • 305
    • 306
    • 307
    • 308
    • 309
    • 310
    • 311
    • 312
    • 313
    • 314
    • 315
    • 316
    • 317
    • 318
    • 319
    • 320
    • 321
    • 322
    • 323
    • 324
    • 325
    • 326
    • 327
    • 328
    • 329
    • 330
    • 331
    • 332
    • 333
    • 334
    • 335
    • 336
    • 337
    • 338
    • 339
    • 340
    • 341
    • 342
    • 343
    • 344
    • 345
    • 346
    • 347
    • 348
    • 349
    • 350
    • 351
    • 352
    • 353
    • 354
    • 355
    • 356
    • 357
    • 358
    • 359
    • 360
    • 361
    • 362
    • 363
    • 364
    • 365
    • 366
    • 367
    • 368
    • 369
    • 370
    • 371
    • 372
    • 373
    • 374
    • 375
    • 376
    • 377
    • 378
    • 379
    • 380
    • 381
    • 382
    • 383
    • 384
    • 385
    • 386
    • 387
    • 388
    • 389
    • 390
    • 391
    • 392
    • 393
    • 394
    • 395
    • 396
    • 397
    • 398
    • 399
    • 400
    • 401
    • 402
    • 403
    • 404

    2.与图片相关的坑

    1.图片不能居中显示

    修改图片显示对应的主体文件

    这是github上的主题图片居中显示片段。
    #write span img {
      display: block;
      margin: 0 auto;
      max-width: 100%;
    }
    #write span img {
      display: inline-block;
      border-right: 0px;
      border-left: 0px;
    }
    
    #修改为所有图片都居中显示,且图片为自动大小
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13

    2.图片显示问题

    1.图片显示模糊(图片质量没问题,但就是显示模糊,即使把typora调到最大化也是模糊)

    原因是对于主体中定义的页面宽度设置有问题导致图片被压缩,显示就有问题,需要修改主体文件页面宽度,确保按照最大宽度,图片能够清晰显示,尤其是截图注释的内容能够清晰显示

    /* 全局属性 */
    #write {
      margin: 0 auto;   /* 实现自动水平居中。设置上下边距为0,左右自动计算 */
      padding: 1rem 4rem;  /* 元素内部添加上下1rem,左右4rem的内边距 */
      font-size: 18px;
      color: black;
      line-height: 1.6;
      word-spacing: 0px;
      letter-spacing: 0px;
      word-break: break-word;
      word-wrap: break-word;
      text-align: left;
      font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    }
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    2.文件发给别人不能正常显示图片

    原因:图片是保存在文件的对应目录下,typora只是引用,发送文件没有发送图片文件,因此导致不能正常显示出来

    此时可以采用图床,把图片上传到图床,这样也就可以直接复制所有内容到博客直接在博客中显示出图片了。具体做法可以看看教程

    [typora+PicGo+githup图床实现图片任意复制不丢失_提取 typora 中的图片_wwzroom的博客-CSDN博客](https://blog.csdn.net/aa896517050/article/details/125246420?ops_request_misc=%7B%22request%5Fid%22%3A%22169777601116800226576947%22%2C%22scm%22%3A%2220140713.130102334.pc%5Fblog.%22%7D&request_id=169777601116800226576947&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2blogfirst_rank_ecpm_v1~rank_v31_ecpm-1-125246420-null-null.nonecase&utm_term=typora &spm=1018.2226.3001.4450)

  • 相关阅读:
    “WingChunTechnique “app Tech Support(URL)
    计算机毕业设计springboot+vue+elementUI球员转会管理系统
    Java基于SpringBoot+Vue的考研资讯平台
    芯昇XS9950,单通道多合一同轴高清解码芯片方案,一路模拟高清,一路AHD
    Cesium快速上手7-3dtiles加载
    SecureCRT连接Amazon EC2 Linux AMI
    Spring IOC核心功能快速入门
    vue3 antv 静态登录页面
    分布式事务Seata源码解析12:全局事务执行流程之全局事务回滚
    Si24R2F+2.4GHz ISM 频段低功耗无线集成嵌入式发射基带无线发射芯片
  • 原文地址:https://blog.csdn.net/aa896517050/article/details/133943759