Is responsive web design the only way to create a mobile website?

Isn't there a way for your browser to detect whether you're using a handheld device or PC and generate code based on that, without changing your CSS when your browser size changes?

Thank you
5 answers 5