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 →

How to style the navigation only on one page

Started by Joseffa Steuernagel 8 years ago · 0 replies · 681 views
8 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 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