Protein adsorption to surfaces is at the heart of numerous technological and bioanalytical applications, but sometimes, it is also associated with medical risks. To deepen our insights into processes involving layers of surface-adsorbed proteins, high-resolution structural information is essential. Here, we use standing-wave X-ray fluorescence (SWXF) in combination with an optimized liquid-cell setup to investigate the underwater conformation of the random-coiled phosphoprotein β-casein adsorbed to hydrophilic and hydrophobized solid surfaces. The orientation of the protein, as determined through the distributions of sulfur and phosphorus, is found to be sensitive to the chemical nature of the substrate. While no preferred orientations are observed on hydrophobized surfaces, on hydrophilic Al oxide, β-casein is adsorbed as a diblock copolymer with the phosphorylated domain I attached to the surface. Our results demonstrate that targeting biologically relevant chemical elements with SWXF enables a detailed investigation of biomolecular layers under near-physiological conditions.