Within the non-coding portions of the genome lie sets of instructions that specify when, where, and how much genes should be expressed. This regulatory function of DNA is of paramount importance in the understanding of development, evolution and disease. These instructions take the form of docking sites for proteins known as transcription factors that bind to control regions known as enhancers. At every level of this process there are outstanding questions, from the logic of multiple transcription factors acting on a single enhancer, to the action of multiple enhancers interacting in a complex genetic locus. This dissertation presents theoretical and experimental work that connects the underlying structure of transcription factor binding sites to the complex regulation of the intact Drosophila melanogaster even-skipped locus, which is expressed in seven transverse stripes across developing embryos. Studies of this locus can take full advantage of previous work that has established a quantitative, single nucleus resolution spatiotemporal atlas of transcription factors levels and gene expression. Models based on physical-chemical interactions between transcription factors and DNA have been developed to explain how enhancers interpret these transcription factor levels in order to specify expression in the appropriate places and times during development. In this dissertation, I present new efficient algorithms and code that allow this type of modeling to be applied at scales that were previously impossible. I show that the enhancer structure of even-skipped arises out of competition between DNA fragments for interaction with the basal transcription machinery. This enhancer competition allows the function of a complex regulatory locus to be connected directly to DNA sequence. In order to test the extent to which the molecular interactions that are implemented in this model fully explain the activity of enhancers, I generate a panel of synthetic enhancers, designed ab initio to drive a single stripe across developing embryos. Analysis of these sequences reveals that the molecular interactions that determine the activity of enhancers have complex dependencies on the position and orientation of sites. Finally, I show that there is a relationship between the length of enhancers and their robustness to perturbation in both transcription factor concentration and genetic mutation. Three files are included this dissertation, including the code that implements the transcription model, the measured expression of even-skipped that the model is trained on, and the parameters of all fits to data.