How to solve that class="mycolour1" will be applied only to specific ID like. section1 id="section1"?
You don't need to. Just use the id by itself in CSS
#section1
The only exception is if there are pages where an element has this id but
not the named class, and you don't want the styling to apply in those cases. That's when you go to justa's double-pronged approach:
#section1.mycolour1
Always remember that in CSS, each space means a new element.
.onething.otherthing
=
<element class = "onething otherthing">
.onething .otherthing
=
<element class = "onething">
{blahblah}
<element class = "otherthing">
Incidentally, is "mycolour1" a real class name, like "class = 'red'" or "class = 'cyan'"? Most of the time this is not the best choice for naming. Otherwise you'll end up, a few redesigns further, with
.red {color: blue;}
.green {color: gray;}
:)