Measurements are presented from turbulent boundary layers over periodic two- and three-dimensional roughness. Cases with transverse rows of staggered cubes and cases with solid square transverse bars of two sizes were considered. Previous results by Volino, Schultz & Flack (J. Fluid Mech. vol. 635, 2009, p. 75) showed outer-layer similarity between cases with three-dimensional roughness and smooth walls, and deviations from similarity in cases with large two-dimensional transverse bars. The present results show that differences also occur with small two-dimensional bars and to a lesser extent when the bars are replaced with rows of staggered cubes. Differences are most apparent in correlations of turbulence quantities, which are of larger spatial extent for the rough-wall cases. The results with the staggered cubes indicate that part of the periodic roughness effect is caused by the repeated disturbance and recovery of the boundary layer as it encounters a row of roughness followed by a smooth surface. A larger effect, however, is due to the blockage caused by the two-dimensional transverse bars, which extend across the entire width of the boundary layer. The small two-dimensional bars have a larger effect than the staggered cubes, in spite of the bar height being only 11 viscous units and 1/7 of the cube height. The effect of the small bars extends well into the outer flow, indicating that effects observed previously with larger bars were not due only to a thickening of the roughness sublayer. The observed differences between the rough- and smooth-wall results are believed to be caused by large-scale attached eddies which extend from the roughness elements to the edge of the boundary layer.