修改页面宽度 #212
-
不知道在哪里可以联系到作者,只能在这里开个issue,请见谅! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
你可以在 在该文件中添加以下 CSS 代码以修改页面宽度。DoIt 主题默认的页面宽度为 60%,你可以将其修改为你喜欢的数值。 需要注意的是,在页面排版中,页面不应该过窄,但也不应该过宽。过宽的页面会导致读者在换行时很难定位下一行的开头。因此,通过百分比控制页面宽度也并非万无一失。在宽屏、带鱼屏上,原先恰当的宽度会被按照百分比继续拉长,导致较差的阅读体验。通过设置
对于分类、系列页面,通过以下 CSS 将每个栏目的宽度调为 100%。这可以使每行只显示一个栏目,让其中所包含的标题显示完整。
另外,你必须使用 extended 版本的 hugo 来生成你的站点以使自定义样式生效。 Reference: 自定义样式 |
Beta Was this translation helpful? Give feedback.
你可以在
your_site/assets/css/_custom.scss
中创建你的自定义样式。在该文件中添加以下 CSS 代码以修改页面宽度。DoIt 主题默认的页面宽度为 60%,你可以将其修改为你喜欢的数值。
需要注意的是,在页面排版中,页面不应该过窄,但也不应该过宽。过宽的页面会导致读者在换行时很难定位下一行的开头。因此,通过百分比控制页面宽度也并非万无一失。在宽屏、带鱼屏上,原先恰当的宽度会被按照百分比继续拉长,导致较差的阅读体验。通过设置
max-width
属性控制页面的最大宽度,可以保证在不同屏幕尺寸下的一致文字阅读体验。对于分类、系列页面,通过以下 CSS 将每个栏目的宽度调为 100%。这可以使每行只显示一个栏目,让其中所包含的标题显示完整。
另外,你必须使用 extended 版本的 hugo 来生成你的站点以使自定义样式生效。
Reference: 自定义样式