In Spain, wear a skirt or long pants when touring cathedrals and other religious sites. Definitely no shorts!
People Also Ask
Shorts are worn in the summer months of June, July, and August. Locals also wear shorts in late spring and early fall if it's hot. Even if you get a random hot day in the winter, Spaniards will not wear shorts.
Men are explicitly requested to wear long pants. Women are requested to wear dresses, skirts and pants that go past the knee. So capri pants are ok. Churches other than at the Vatican are more lenient on this one but still request clothing that covers the knee.