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

How to style the navigation only on one page

Started by Joseffa Steuernagel 7 years ago · 0 replies · 402 views
7 years ago

Hey, I'm completely new to Grav. I'm in the process of styling a page and would like to have the navigation bar on the home page styled differently than on all the other pages. But I don't understand how I can "grab" it alone. To style the background of the home page I used the following code in the base.html.twig:

<body class="{{ page.header.body_classes }}{% if page.home %} home{% endif %}"{% if page.home %} style="background-image: url('{{theme_url}}/assets/my-picture.jpg' );"{% endif %}>

and then wrote this in the CSS:

CSS
.home {
   background: no-repeat cover center;
}

That works perfectly fine to only style the background of the home-page.
Is there a similar syntax to only style the navigation area? I use the Hyde theme in combination with my own CSS.

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by Pedro M, 2 months ago
4 241 2 months ago
Themes & Styling · by Ian, 2 months ago
3 123 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 488 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 75 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 156 3 months ago