Adaptation to novel conditions beyond current range boundaries requires the presence of suitable sites within dispersal range, but may be impeded when emigrants encounter poor habitat and sharply different selection pressures. We investigated fine-scale spatial heterogeneity in ecological dynamics and selection at a local population boundary of the annual plant Gilia tricolor. In two years, we planted G. tricolor seeds in core habitat, margin habitat at the edge of the local range, and exterior habitat in order to measure spatial and temporal variation in habitat quality, opportunity for selection, and selection on phenotypic traits. We found a striking decline in average habitat quality with distance from the population core, yet some migrant seeds were successful in suitable, unoccupied microsites at and beyond the range boundary. Total and direct selection on four out of five measured phenotypic traits varied across habitat zones, as well as between years. Moreover, the margin habitat often exerted unique selection pressures that were not intermediate between core and exterior habitats. This study reveals that a combination of ecological and evolutionary forces, including propagule limitation, variation in habitat quality and spatial heterogeneity in phenotypic selection may reduce opportunities for adaptive range expansion, even across a very local population boundary.