First-principles calculations have been employed to investigate structural stability and electronic properties of non-polar (1 (1) over bar 00) and (11 (2) over bar0) ZnO/GaN heterostructured nanofilms. The effects of nanofilm thickness and GaN ratio are considered. It has been found that all studied heterostructured nanofilms are less stable than the corresponding pure ZnO film but more stable than pure GaN one, exhibiting a much thicker film with better stability. Electronic band structures display that both two types of heterostructured nanofilms are semiconductors with their band gaps strongly depending on the GaN ratios as well as the thicknesses. Of particular interest is that the band gaps decrease firstly, and then increase with the increasing GaN ratio, showing flexibly tunable band gaps that cover a wide range of the solar spectrum. Furthermore, spatial charge distribution to the valence band maximum and the conduction band minimum has been studied. By calculating the complex dielectric function, the properties of optical absorption has been explored to exploit their potential application in the solar energy harvesting. (C) 2017 Elsevier B.V. All rights reserved.