Lens, comprising: - a container defining a volume which is filled with a transparent liquid, wherein the container comprises a transparent and elastically deformable membrane and a rigid member, wherein the membrane and the rigid member delimit said volume, and - a lens shaping element that contacts the membrane and defines an area of said membrane, which area has an adjustable curvature for adjusting the focal length of the lens, and wherein the lens is configured to compensate a thermal expansion of the liquid and/or a change of the refractive index of the liquid due to an increased temperature of the liquid in order to reduce an unwanted thermally induced change of the focal length of the lens, wherein the container further comprises a ring member for compensating said thermal expansion of the liquid, wherein said ring member is connected to the rigid member and extends circumferentially along an extension plane and comprises a dimension in a direction (z) perpendicular to said extension plane, wherein the ring member is in thermal contact with said liquid and is configured to expand when the temperature of the liquid increases such that said volume increases, wherein said increase in volume corresponds to an increase of the volume of the liquid that occurs when the temperature of the liquid increases such that the curvature of said area of the lens remains constant when the temperature of the liquid increases, and wherein the rigid member comprises a base extending along said extension plane and a protrusion protruding from the base in said direction (z) normal to said extension plane, and the lens being characterized in that the height of the ring member in the direction (z) is larger than the height of the liquid in the volume in the same direction (z), and wherein the radial expansion of the liquid container is smaller than the radial expansion of the liquid, wherein said ring member encompasses said protrusion, and wherein the ring member and said protrusion define a circumferential gap being filled with said liquid, which gap forms part of said volume of the container. - a container defining a volume which is filled with a transparent liquid, wherein the container comprises a transparent and elastically deformable membrane and a rigid member, wherein the membrane and the rigid member delimit said volume, and - a lens shaping element that contacts the membrane and defines an area of said membrane, which area has an adjustable curvature for adjusting the focal length of the lens, and the lens is configured to compensate a thermal expansion of the liquid and/or a change of the refractive index of the liquid due to an increased temperature of the liquid in order to reduce an unwanted thermally induced change of the focal length of the lens, wherein the container further comprises a ring member for compensating said thermal expansion of the liquid, wherein said ring member is connected to the rigid member and extends circumferentially along an extension plane and comprises a dimension in a direction (z) perpendicular to said extension plane, wherein the ring member is in thermal contact with said liquid and is configured to expand when the temperature of the liquid increases such that said volume increases, wherein said increase in volume corresponds to an increase of the volume of the liquid that occurs when the temperature of the liquid increases such that the curvature of said area of the lens remains constant when the temperature of the liquid increases, and wherein the rigid member comprises a base extending along said extension plane and a protrusion protruding from the base in said direction (z) normal to said extension plane, and the lens being characterized in that the height of the ring member in the direction (z) is larger than the height of the liquid in the volume in the same direction (z), and wherein the radial expansion of the liquid container is smaller than the radial expansion of the liquid, wherein said ring member encompasses said protrusion, and wherein the ring member and said protrusion define a circumferential gap being filled with said liquid, which gap forms part of said volume of the container.