Simple keyframes will make a layer move. Adding a LoopOut expression will loop between the keyframes.
Not sure what you mean by an HTML5 file. AE makes movie files. HTML5 will playback mp4's What exactly are you trying to do?
What Rick said - what does AE have to do with HTML? If you meant to post this in the Flash forum, then please do. Otherwise I could think of a million better ways to do such a simple thing from using Edge to manually crafting an animation based on jQuery and one of its gigazillion extensions.