This is invalid markup. Ids should be unique to a page.If you want to apply the same css style to multiple elements, use classes.

The way to solve this, is to give each of these elements the same class, use $('.main') to get a reference to all of them, then iterate over them using [each](http://api.jquery.com/jQuery.each/) to apply the desired behaviour.

If you run into any problems, let me know.

P.S. Please use code tags for your future posts. It makes the code easier to read for anyone who is trying to help you.