Блокируйте контент в верхней части тела героя с помощью Bulma

У меня есть страница с элементом героя полной высоты, и я хочу «приклеить» содержимое, которое находится в <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">&nbsp;by Artemis&trade;</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>&nbsp;Actions&trade;</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>&nbsp;&nbsp;Security&trade;&nbsp;<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">
                        &copy; 2020 <a href = "https://rgbcraft.com" class = "has-text-grey-darker">RGBCraft</a> & Artemis&trade;.
                        <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>
Раскрытие чувствительных данных
Раскрытие чувствительных данных
Все внешние компоненты, рассмотренные здесь до сих пор, взаимодействуют с клиентской стороной. Однако, если они подвергаются атаке, они не...
Разница между тегами Br и Wbr в HTML 5
Разница между тегами Br и Wbr в HTML 5
В целом, оба тега <br> и <wbr> имеют свои уникальные цели и функциональные возможности, и их использование зависит от конкретных требований к дизайну...
HTML И VS CODE Для Веб-разработки
HTML И VS CODE Для Веб-разработки
Прежде чем начать кодировать html в "VS CODE", мы должны сначала создать папку и назвать ее x.html, здесь я принимаю x как имя файла, который мы...
Как использовать WAI-ARIA
Как использовать WAI-ARIA
В моем текущем новом проекте почти все компоненты не учитывают веб-доступность. Моя нынешняя компания - это стартап, поэтому они не заботились о...
Статическая веб-страница, созданная с помощью CSS и HTML - до и не до.
Статическая веб-страница, созданная с помощью CSS и HTML - до и не до.
Я потратил некоторое время на создание своего сайта-портфолио. Затем, гордясь собой, я разместил свой код на серверах amazon. Мне потребовалось время,...
4
0
1 256
2
Перейти к ответу Данный вопрос помечен как решенный

Ответы 2

В основном то, чего вы пытаетесь достичь, толкает содержимое снизу вверх, не отображая верхний контент вместо того, чтобы устанавливать видимость верхней части невидимой

Попробуйте это (в вашем class="hero-head")

<div class = "hero-head display is-hidden-mobile">

Пожалуйста, обратитесь к этой документации для получения дополнительных разъяснений.

Я отредактировал вопрос и добавил то, что хочу.

alex3025 21.12.2020 12:33

Этот фрагмент работает/отображается так же, как ваша картинка в режиме рабочего стола

iceweasel 21.12.2020 16:44

Я попробовал это, и это не работает так, как задумано.

alex3025 21.12.2020 16:53

Почему бы вам не попробовать создать веб-страницу в бутстрапе? есть богатая документация, множество учебных пособий, поддержка

iceweasel 21.12.2020 18:17
Ответ принят как подходящий

Добавьте следующие классы, как показано ниже:

<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">&nbsp;by Artemis&trade;</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>&nbsp;Actions&trade;</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>&nbsp;&nbsp;Security&trade;&nbsp;<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">
            &copy; 2020 <a href = "https://rgbcraft.com" class = "has-text-grey-darker">RGBCraft</a> & Artemis&trade;.
            <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>

Другие вопросы по теме