Here is my situation. I have 3 divs on my website. There is a button in each of divs. Here is my codes :
<div id="gg1">
<a class="btn">
</div>
<div id="gg2">
<a class="btn">
</div>
<div id="gg3">
<a class="btn">
<开发者_StackOverflow社区/div>
May I know how to apply css style to 1 button only without effect on other 2 buttons Css or Jquery? Note that I cannot change the class and id of the buttons.
Use a descendant selector:
#gg1 a.btn {
/* styles here affect only a.btn elements within #gg1 */
}
精彩评论