gpt4 book ai didi

html - MaterializeCSS 侧边栏显示问题

转载 作者:太空宇宙 更新时间:2023-11-04 15:03:06 24 4
gpt4 key购买 nike

我在使用 Materialize CSS 时遇到了这个奇怪的问题,其中边栏与“主”面板中的内容以及页脚 (see image here: most content is censored on the page, the "m" in the title is part of the title text "Problem Submission") 重叠,尽管我认为我的网格设置正确。 Chrome 和 Safari 都会发生这种情况(我打赌 IE 也不会有希望)。这是我的文档的基本结构,以下所有标记都在 <body> 中标签(这是一个 Jinja 模板,包含脚本,所有内容都位于“基本”模板中):

<header>
<nav class="top-nav green">
<div class="container">
<a href = "#" data-activates="nav-mobile" class="button-collapse top-nav full hide-on-large-only"><i class="material-icons">menu</i></a>
</div>
<div class="container">
<div class="nav-wrapper"><span id="logo-container" class="brand-logo">{{ self.title() }}</span></div>
</div>
</nav>
<ul id="nav-mobile" class="side-nav fixed">
<li class="logo"><a id="logo-container" href="/" class="brand-logo">Brand Name</a></li>
<li></li>
<li></li>
<li></li>
{% block navlinks %}
<li class="bold"><a href="/" class="waves-effect waves-teal">Back to Home</a></li>
{% endblock %}
</ul>
</header>
<main>
<div class="container">
<div class="row">
<div class="col s12">
{% block jumbo_content %}{% endblock %}
</div>
</div>
<div class="row">
<div class="col s12 m9 l10"><!-- Main content goes here -->
{% block main_content %}
{% endblock %}
</div>
<div class="col hide-on-small-only m3 l2"><!-- Nothing goes here (usually TOC -->
{% block toc_content %}
{% endblock %}
</div>
</div>
</div>
</main>
<footer class="page-footer green" style = "position: -webkit-sticky;">
<div class="container">
<div class="row">
<div class="col l9 m9 s12">
<h5 class="white-text">Brand Name</h5>
<p class="grey-text text-lighten-4">Description</p>
</div>
<div class="col l3 m3 offset-m3">
<h5 class="white-text">Important Links</h5>
<ul>
<li><a class="white-text" href="/login">Login</a></li>
<li><a class="white-text" href="/contact_us">Contact Us</a></li>
<li><a class="white-text" href="/about">About</a></li>
</ul>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">
Copyright notice
</div>
</div>
</footer>

有没有人遇到过类似的问题,或者有人能指出我的 HTML 布局有问题吗?

最佳答案

如果您检查 side nav documentation并一直滚动到底部,它显示了在使用固定侧边导航时如何偏移内容。

基本上,您只需在整个内容中添加一个 padding。

 header, main, footer {
padding-left: 240px;
}

@media only screen and (max-width : 992px) {
header, main, footer {
padding-left: 0;
}
}

媒体查询将确保当您的侧导航在较小的屏幕上消失时填充消失。您还可以根据侧边导航的大小调整左侧边距的大小。

关于html - MaterializeCSS 侧边栏显示问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31643950/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com