Skip to content
Grav 2.0 is officially stable. Read the announcement →
Themes & Styling

[Solved] Learn2 Sticky Header

Started by Johann 8 years ago · 0 replies · 978 views
8 years ago

Hey guys,

I am new to GRAV and already did some tweaking in the Learn2 Template, which I want to use for documentation purposes.

I already added a new section to the upper part and was able to implement 2 logos of product and company.

Now I want the section at the top to be in front of the text. So when scrolling down the text should disappear under the bar at the top. Now the text is in front of the bar.

Here is the code:

CSS:

navbar-section {

YAML
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 65px;
  opacity: 1.0;
  background: rgba(239, 239, 239,1.0);
}

HTML/TWIG:

TWIG
{% block navbar %}
    <div id="navbar-section" class="section">
        <div class="content-container">
           <a class="logo" href="{{ '/' | page }}">
                         <img src="{{ url('theme://images/logo.png') }}" alt="{{ 'Logo'|t }}"/>
            </a>
        </div>
    </div>
{% endblock %}

Can anyone please give advise?

opacity|690x321

Update: I already found solution. I simply added z-index=1 to the CSS part

last edited 07/25/18 by Johann

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by Pedro M, 2 months ago
4 233 2 months ago
Themes & Styling · by Ian, 2 months ago
3 121 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 486 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 74 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 154 3 months ago