Can we give different elements same id and what if we insert same parameter like color in different styles defined for different class selectors like p1 and p2 and there is an element which is a part of both the classes
then which color will it have p1 or p2
Different id and classes
No, all elements have unique id.
For second question, read this: https://stackoverflow.com/a/12258654/8183406