Man, you've got me missing the old style baby food jars now! :->
Screw the lids to the bottom of a shelf.
That's how grampa taught me, and I still keep odds and ends of fasteners and what-not like that in one of my shops.
Gawd that makes me feel like an old boomer, but I don't care. It's effective, and saves trips to town to buy one stupid wingnut.
'Course the downside is - if I don't make a trip to the hardware store for the wingnut, I can't get a smoked polish dog with kraut at the roach coach that sets up by the store.