0

我正在使用 Docsify 显示一些降价页面,但我遇到了一个问题:主页index.html没有滚动浏览我在README.md.

这是我的index.html页面:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>My Documentation</title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="description" content="My Documentation Description">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css">
  <script type="text/javascript">
    document.querySelector('link[title=theme]').href="//unpkg.com/docsify/lib/themes/dark.css";
  </script>
  <style type="text/css">
    .sidebar li {
      margin: 0;
      line-height: 1.7em;
    }
    .sidebar ul li ul {
      padding-bottom: 10px;
    }
    .sidebar-nav>ul>li>p {
      font-size: 17px;
      text-transform: uppercase;
    }
  </style>
</head>
<body>
  <div id="app">Loading....</div>
  <script src="//unpkg.com/docsify-edit-on-github/index.js"></script>
  <script>
    window.$docsify = {
      name: 'My Docs',
      repo: '',
      auto2top: true,
      executeScript: true,
      loadSidebar: true,
      maxLevel: 4,
      subMaxLevel: 1,
      search: {
        paths: 'auto',
      },
    }
  </script>
  <script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
  <script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
  <script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
  <script src="//unpkg.com/docsify/lib/plugins/emoji.min.js"></script>
  <script src="//unpkg.com/docsify-copy-code"></script>
  <script src="//unpkg.com/prismjs/components/prism-php.min.js"></script>
  <script src="//unpkg.com/prismjs/components/prism-sql.min.js"></script>
  <script src="//unpkg.com/prismjs/components/prism-json.min.js"></script>
</body>
</html>

这是我的README.md页面:

# My Personal Documentation

Some documentation

angularStuff: 

asanaStuff: 

assemblyStuff: 

&nbsp;  
&nbsp;  

bashStuff: 

batchStuff: 

bootstrapStuff: 

my repo
- **this is my docs repo for these docs**
&nbsp;  
&nbsp;  

cards: 
- **repository to keep track of**
&nbsp;  
&nbsp;  

cSharpStuff:
&nbsp;  
&nbsp;  

excelStuff: 

javaStuff:

javaScriptStuff: 

&nbsp;  
&nbsp;  

luaStuff: 

&nbsp;  
&nbsp;  

miscStuff: 
- **miscellaneous stuff I couldn't think of where to put**
&nbsp;  
&nbsp;  

mySQLStuff: 

&nbsp;  
&nbsp;  

oracleStuff: 

&nbsp;  
&nbsp;  

phpStuff: 

prs: 
- **repository to keep track of PRs I reviewed from **
&nbsp;  
&nbsp;  

pythonStuff: 

&nbsp;  
&nbsp;  

rubyStuff: yStuff

&nbsp;  
&nbsp;  

sqlServerStuff: ServerStuff

&nbsp;  
&nbsp;  

typeScriptStuff: eScriptStuff

&nbsp;  
&nbsp;  

vueStuff: 

&nbsp;  
&nbsp;  

writing: 

这是它如何为我显示的屏幕截图:

在此处输入图像描述

请注意,在我的屏幕截图中显示的最后一件事是javaScriptStuff:,但是如果您查看我README.md的内容,那之后有很多东西我应该可以滚动到但我不能。

在此屏幕截图中并没有真正看到它,但右侧没有滚动条可以让我向下滚动以查看其余内容。

与往常一样,一个正确的、解释清楚的答案将被标记为接受的答案并被赞成。

提前致谢。

4

2 回答 2

1

在我发布这个问题后,我问了几个同事,并被引导到我的问题的答案。我需要overflow在我的 .css 块中指定一个值index.html

我所要做的就是添加这个:

.content {
  overflow: auto;
}

到我的块开始,<style type="text/css">现在垂直滚动条是可见的。

于 2020-09-01T16:23:43.503 回答
0

我尝试了另一种解决方案,它几乎可以工作,但多级菜单上的锚点停止工作。

我可以用这个来解决它:

body:not(.ready) {
  overflow: auto;
}

当我使用 Presite 保存仅 HTML 的站点时,页面停止滚动。

于 2021-09-04T01:42:34.680 回答