У меня есть страница с элементом героя полной высоты, и я хочу «приклеить» содержимое, которое находится в <div class = "hero-body">, в верхней части его контейнера, потому что теперь оно центрируется автоматически, а я этого не хочу (это панель инструментов...). Как я могу сделать?
Заранее спасибо.
Это похоже на то, что я хочу:
В настоящее время это мой код:
<link href = "https://cdn.jsdelivr.net/npm/bulma@0.9.1/css/bulma.min.css" rel = "stylesheet"/>
<section class = "hero is-fullheight-with-navbar">
<!-- Hero head: will stick at the top -->
<div class = "hero-head">
<div class = "container">
<div class = "columns is-centered">
<div class = "column is-four-fifths">
<nav class = "navbar is-spaced" role = "navigation" aria-label = "main navigation">
<div class = "navbar-brand">
<a class = "navbar-item" href = "{{ url_for('home') }}">
<img src = "{{ url_for('static', filename='images/logo-m.png') }}" alt = "logo">
<span class = "has-text-grey-dark"> by Artemis™</span>
</a>
<a role = "button" class = "navbar-burger" aria-label = "menu" aria-expanded = "false" data-target = "navbarBasicExample">
<span aria-hidden = "true"></span>
<span aria-hidden = "true"></span>
<span aria-hidden = "true"></span>
</a>
</div>
<div id = "navbarBasic" class = "navbar-menu">
<div class = "navbar-end">
<a class = "navbar-item has-text-grey" href = "{{ url_for('home') }}">Home</a>
<div class = "navbar-item">
<a class = "button is-primary is-rounded" href = "{{ url_for('auth.login') }}">
<strong>Login</strong>
</a>
</div>
</div>
</div>
</nav>
</div>
</div>
</div>
</div>
<!-- Hero content: will be in the middle -->
<div class = "hero-body">
<div class = "container">
<div class = "columns is-centered">
<div class = "column is-narrow">
<aside class = "menu">
<p class = "menu-label">Servizi Arc</p>
<ul class = "menu-list">
<li>
<a href = "{{ url_for('dashboard.actions') }}" class = "{{ 'is-active' if 'actions' in request.path else '' }}"><i class = "fas fa-project-diagram"></i> Actions™</a>
<ul style = "{{ 'display: block;' if 'actions' in request.path else 'display: none;' }}">
<li><a>Members</a></li>
<li><a>Plugins</a></li>
<li><a>Add a member</a></li>
</ul>
</li>
<a><i class = "fas fa-shield-alt"></i> Security™ <span class = "tag is-primary is-rounded">In arrivo</span></a>
</ul>
</aside>
</div>
<div class = "column is-7">
<div class = "box">
<h1 class = "title has-text-weight-light">
Hello, <span class = "has-text-weight-bold">username</span>.
</h1>
<p class = "subtitle is-5 has-text-grey">Seleziona un servizio per continuare...</p>
</div>
</div>
</div>
</div>
</div>
<!-- Hero footer: will stick at the bottom -->
<div class = "hero-foot">
<footer style = "border-top: 1px solid hsl(0, 0%, 93%); padding-top: 1.7rem;">
<div class = "container">
<div class = "columns is-vcentered is-centered has-text-centered-mobile">
<div class = "column is-narrow">
<img src = "{{ url_for('static', filename='images/logo-s.png') }}" alt = "logo">
</div>
<div class = "column is-3">
<h5 class = "title is-5 has-text-grey-light has-text-weight-normal is-italic">
Arc ha come obiettivo il creare un'ecosistema semplice ma potente per aiutarti a gestire tutte le tue operazioni.
</h5>
</div>
<div class = "column is-4 is-narrow">
© 2020 <a href = "https://rgbcraft.com" class = "has-text-grey-darker">RGBCraft</a> & Artemis™.
<br>
<i>Tutti i diritti riservati.</i>
</div>
<div class = "column is-narrow">
Sitemap
<ul>
<li><a class = "has-text-grey" href = "{{ url_for('home') }}">Home</a></li>
<li><a class = "has-text-grey" href = "{{ url_for('auth.login') }}">Login</a></li>
</ul>
</div>
</div>
</div>
</footer>
</div>
</section>
В основном то, чего вы пытаетесь достичь, толкает содержимое снизу вверх, не отображая верхний контент вместо того, чтобы устанавливать видимость верхней части невидимой
Попробуйте это (в вашем class="hero-head")
<div class = "hero-head display is-hidden-mobile">
Пожалуйста, обратитесь к этой документации для получения дополнительных разъяснений.
Этот фрагмент работает/отображается так же, как ваша картинка в режиме рабочего стола
Я попробовал это, и это не работает так, как задумано.
Почему бы вам не попробовать создать веб-страницу в бутстрапе? есть богатая документация, множество учебных пособий, поддержка
Добавьте следующие классы, как показано ниже:
<div class = "hero-body is-align-items-stretch"> <!-- the important class is here -->
<div class = "container is-flex">
<div class = "columns is-centered is-flex-grow-1">
<div class = "column is-narrow">
....
</div>
<!-- the below one (is-align-self-center) is not mandatory if you don't want to center the banner -->
<div class = "column is-7 is-align-self-center">
....
</div>
Полный код
<link href = "https://cdn.jsdelivr.net/npm/bulma@0.9.1/css/bulma.min.css" rel = "stylesheet" />
<section class = "hero is-fullheight-with-navbar">
<!-- Hero head: will stick at the top -->
<div class = "hero-head">
<div class = "container">
<div class = "columns is-centered">
<div class = "column is-four-fifths">
<nav class = "navbar is-spaced" role = "navigation" aria-label = "main navigation">
<div class = "navbar-brand">
<a class = "navbar-item" href = "{{ url_for('home') }}">
<img src = "{{ url_for('static', filename='images/logo-m.png') }}" alt = "logo">
<span class = "has-text-grey-dark"> by Artemis™</span>
</a>
<a role = "button" class = "navbar-burger" aria-label = "menu" aria-expanded = "false" data-target = "navbarBasicExample">
<span aria-hidden = "true"></span>
<span aria-hidden = "true"></span>
<span aria-hidden = "true"></span>
</a>
</div>
<div id = "navbarBasic" class = "navbar-menu">
<div class = "navbar-end">
<a class = "navbar-item has-text-grey" href = "{{ url_for('home') }}">Home</a>
<div class = "navbar-item">
<a class = "button is-primary is-rounded" href = "{{ url_for('auth.login') }}">
<strong>Login</strong>
</a>
</div>
</div>
</div>
</nav>
</div>
</div>
</div>
</div>
<!-- Hero content: will be in the middle -->
<div class = "hero-body is-align-items-stretch">
<div class = "container is-flex">
<div class = "columns is-centered is-flex-grow-1">
<div class = "column is-narrow">
<aside class = "menu">
<p class = "menu-label">Servizi Arc</p>
<ul class = "menu-list">
<li>
<a href = "{{ url_for('dashboard.actions') }}" class = "{{ 'is-active' if 'actions' in request.path else '' }}"><i class = "fas fa-project-diagram"></i> Actions™</a>
<ul style = "{{ 'display: block;' if 'actions' in request.path else 'display: none;' }}">
<li><a>Members</a></li>
<li><a>Plugins</a></li>
<li><a>Add a member</a></li>
</ul>
</li>
<a><i class = "fas fa-shield-alt"></i> Security™ <span class = "tag is-primary is-rounded">In arrivo</span></a>
</ul>
</aside>
</div>
<div class = "column is-7 is-align-self-center">
<div class = "box">
<h1 class = "title has-text-weight-light">
Hello, <span class = "has-text-weight-bold">username</span>.
</h1>
<p class = "subtitle is-5 has-text-grey">Seleziona un servizio per continuare...</p>
</div>
</div>
</div>
</div>
</div>
<!-- Hero footer: will stick at the bottom -->
<div class = "hero-foot">
<footer style = "border-top: 1px solid hsl(0, 0%, 93%); padding-top: 1.7rem;">
<div class = "container">
<div class = "columns is-vcentered is-centered has-text-centered-mobile">
<div class = "column is-narrow">
<img src = "{{ url_for('static', filename='images/logo-s.png') }}" alt = "logo">
</div>
<div class = "column is-3">
<h5 class = "title is-5 has-text-grey-light has-text-weight-normal is-italic">
Arc ha come obiettivo il creare un'ecosistema semplice ma potente per aiutarti a gestire tutte le tue operazioni.
</h5>
</div>
<div class = "column is-4 is-narrow">
© 2020 <a href = "https://rgbcraft.com" class = "has-text-grey-darker">RGBCraft</a> & Artemis™.
<br>
<i>Tutti i diritti riservati.</i>
</div>
<div class = "column is-narrow">
Sitemap
<ul>
<li><a class = "has-text-grey" href = "{{ url_for('home') }}">Home</a></li>
<li><a class = "has-text-grey" href = "{{ url_for('auth.login') }}">Login</a></li>
</ul>
</div>
</div>
</div>
</footer>
</div>
</section>
Я отредактировал вопрос и добавил то, что хочу.