Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

[Solved] Learn2 Sticky Header

Started by Johann 8 years ago · 0 replies · 1296 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 MarkP, 2 weeks ago
3 193 2 weeks ago
Themes & Styling · by TomW, 2 weeks ago
0 111 2 weeks ago
Themes & Styling · by themetman, 3 weeks ago
1 206 3 weeks ago
Themes & Styling · by AH, 1 month ago
1 324 3 weeks ago
Themes & Styling · by Bruno, 4 years ago
6 1523 3 weeks ago