In two experiments we explored the instructional value of a cross-domain mapping between "number" and "line" in secondary school students' understanding of density. The first experiment investigated the hypothesis that density would be more accessible to students in a geometrical context (infinitely many points on a straight line segment) compared to a numerical context (infinitely many numbers in an interval). The participants were 229 seventh to eleventh graders. The results supported this hypothesis but also showed that students' conceptions of the line segment were far from that of a dense array of points. We then designed a text-based intervention that attempted to build the notion of density in a geometrical context, making explicit reference to the number-to-points correspondence and using the "rubber line" bridging analogy (the line as an imaginary unbreakable rubber band) to convey the no-successor principle. The participants were 149 eighth and tenth graders. The text intervention improved student performance in tasks regarding the infinity of numbers in an interval; the "rubber line" bridging analogy further improved performance successfully conveying the idea that these numbers can never be found one immediately next to the other.