The contributions to the magnetic anisotropy of thin-film rings and lines of width 50 nm and above made from Ti͑5 nm͒ / Co 0.66 Cr 0.22 Pt 0.12 ͑10 and 20 nm͒/Ti ͑3 nm͒ with a perpendicular magnetocrystalline anisotropy are investigated, using magnetic force microscopy to image the ac-demagnetized state. Four regimes of behavior were observed in both lines and rings. Samples with the largest widths ͑Ͼ500 nm͒ showed an out-ofplane maze domain structure typical of unpatterned films with domain widths of ϳ200 nm. As the linewidth decreased, a "bamboo" domain structure forms in which the domain walls lie approximately perpendicular to the linewidth. Further linewidth decreases result in a reorientation to a net in-plane anisotropy perpendicular to the linewidth, and for the narrowest lines, Ͻ200-nm wide, the anisotropy reorients in plane parallel to the line. The evolution of anisotropy is modeled in terms of contributions from magnetocrystalline, shape, and first-and second-order magnetoelastic terms, and good agreement with experiment is obtained, considering both bulk and surface anisotropy contributions.