Sometimes you'd like to be able to restrict the number of items shown in the gallery collection. For example just say you want to show the six most recent blog posts from your blog database.
Here is some custom CSS to be able to do this, Add this CSS to the Code > CSS section:
.notion-collection-card:nth-child(n+7) {
display: none !important;
}
This will hide the 7th and subsequent gallery cards. Adjust the value 7 to show more or fewer cards.
Note that this will affect all gallery collections.
How to target a specific gallery
If you want to target a specific gallery then you'll need to get the block ID of the gallery by inspecting the page code.
Use the browser developer tools to inspect the code and select the gallery.
Here in this example the notion-collection
has a block ID of
โblock-f8867ff194484e08a0ff2e87cf889e62
Add the block ID to the CSS:
#block-f8867ff194484e08a0ff2e87cf889e62 .notion-collection-card:nth-child(n+7) {
display: none !important;
]