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 · 507 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 stuart young, 2 weeks ago
3 251 2 weeks ago
Themes & Styling · by Sebadamus, 3 weeks ago
5 320 3 weeks ago
Themes & Styling · by martynfoster735, 4 weeks ago
1 310 4 weeks ago
Themes & Styling · by Justin Young, 1 month ago
1 348 1 month ago
Themes & Styling · by Slebeig, 2 months ago
4 474 2 months ago