html
<div class="wrapper">
<button class="btn btn-primary bt7">움직여</button>
<button class="btn btn-primary bt8">움직여</button>
<button class="btn btn-primary bt9">움직여</button>
</div>
<div class="wrapper2">
<div class="box2"></div>
<div class="box3"></div>
<div class="box4"></div>
<div class="box5"></div>
</div>
css
.box5 {width: 100px; height: 100px; background-color: crimson; position: absolute; top: 360px; transition: all 1s; left: 0;}
.box5.active {background-color: blue; width: 500px; height: 500px; left: 500px; transform: rotate(360deg);}
js
$('.bt9').click(function() {
$('.box5').addClass('active');
});
여기서 .box5 띄어쓰고 .active하면 적용이 안되고 저렇게 딱 붙여야지만 먹더라고
근데 다른 css들은 .box5 .active 이런식으로 띄어쓰고 .쓰고 해도 css효과가 먹었는데 왜 안되는거야?
선택자 ㅎㅅㅎ - dc App
ㅎㅅㅎ...?!
모바일이랑 글이 다 안보이네 ㅠ
모바일에서는 이 내용이 안보이는거야 ?? vs에서 복붙해와서 그런가..
.box5.active는 box5이면서 active를 가진놈이고 .box5 .active는 box5 밑에있는 active5임
active5가아니라 active
아ㅏㅏㅏㅏㅏㅏㅏㅏㅏ 그런거구나 아이고 정말 고마워 ㅠㅠㅠㅠㅠㅠ 클릭하면 box5에 active클래스가 생기도록 만들었는데 밑이 아니라 가진놈이기 때문에 그런거구나 3Q3Q!!