Pure HTML can't do that - it's a "static text" based format, and has no real processing ability.
Normally you would do this an Javascript, but it is possible to access the UserAgent string in the code behind which serves the HTML to the client browser. For example:
HttpRequest.UserAgent Property (System.Web) | Microsoft Docs[
^]
But ... be aware it is very easy to "spoof" a UserAgent string - I ran for years with my browser reporting it used
LCARS[
^] instead of Chromium ...