The present invention provides a composition for skin or hair which achieves an excellent UV absorption in a wide range of UV wavelength from the UV-A to the UV-B without inhibiting the effect of the alkyl β,β-diphenylacrylate and the α-cyano-β,β-diphenylacrylate (e.g. octocrylene) which serve to improve the photostability of dibenzoylmethane derivative. The composition for skin or hair comprises: (a) a dibenzoylmethane derivative, (b) an alkyl β,β-diphenylacrylate and/or an α-cyano-β,β-diphenylacrylate (e.g. octocrylene), and (c) a specific benzalmalonate derivative (e.g. di (2-ethylhexyl)-4-methoxybenzalmalonate).