Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

[Solved] Learn2 Sticky Header

Started by Johann 8 years ago · 0 replies · 1173 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 FrViPofm, 4 weeks ago
4 474 2 weeks ago
Themes & Styling · by johan thomas, 5 years ago
1 800 3 weeks ago
Themes & Styling · by stuart young, 2 months ago
3 660 2 months ago
Themes & Styling · by Sebadamus, 3 months ago
5 680 2 months ago
Themes & Styling · by martynfoster735, 3 months ago
1 642 3 months ago