I have an html page with divs that have id(s) of the form s1, s2 and so on.
First of all, there are many, many ways of matching items within a HTML document. Start with this reference to see some of the available selectors/patterns which you can use to apply a style rule to an element(s).
http://www.w3.org/TR/selectors/
Match all divs which are direct descendants of #main.
#main > div
Match all divs which are direct or indirect descendants of #main.
#main div
Match the first div which is a direct descendant of #sections.
#main > div:first-child
Match a div with a specific attribute.
#main > div[foo="bar"]