Light elements such as alkali metal (lithium, sodium) or halogen (fluorine, chlorine) are present in various substances and indeed play significant roles in our life. Although atomic behaviours of these elements are often a key to resolve chemical or biological activities, they are hardly visible in transmission electron microscope because of their smaller scattering power and higher knock-on probability. Here we propose a concept for detecting light atoms encaged in a nanospace by means of electron energy loss spectroscopy using inelastically scattered electrons. In this method, we demonstrate the single-atom detection of lithium, fluorine, sodium and chlorine with near-atomic precision, which is limited by the incident probe size, signal delocalization and atomic movement in nanospace. Moreover, chemical shifts of lithium K-edge have been successfully identified with various atomic configurations in one-dimensional lithium compounds.