Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

How to style the navigation only on one page

Started by Joseffa Steuernagel 7 years ago · 0 replies · 550 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 FrViPofm, 21 hours ago
1 34 8 hours ago
Themes & Styling · by stuart young, 1 month ago
3 480 1 month ago
Themes & Styling · by Sebadamus, 2 months ago
5 481 2 months ago
Themes & Styling · by martynfoster735, 2 months ago
1 460 2 months ago
Themes & Styling · by Justin Young, 2 months ago
1 491 2 months ago