css질문 채택완료
YJK
7년 전
조회 1,890
</p>
<p>안녕요 <span class="hid"><font color="Red">바</font>이루</span></p>
<p><style></p>
<p>.hid{margin:0 !important;padding:1px 0 !important;color:#e9e9e9 !important ;background-color:#e9e9e9 !important; cursor:pointer !important;-
ms-user-select: none; -moz-user-select: -moz-none; -khtml-user-select: none; -webkit-user-select: none; user-select: none;position:relative;z-index:999}</p>
<p></style>
<script>
$(function(){
$(".hid").click(function(){
$(this).removeClass("hid");
});
});
</script></p>
<p>
이런식으로 되어있는 소스 코드가 있습니다.
위 코드를 보면 아래 이미지처럼 나옵니다.

회색부분을 겉어내면

이렇게 나오는데요...
font-color red를 회색을 누르면 적용되어잇게 하고 싶은데...
어떻게 해야되나요??
퀴즈 관련 용도로 쓰려고하는데..
댓글을 작성하려면 로그인이 필요합니다.
답변 2개
7년 전
잘 될지 잘 모르겠습니다만, 조금 쉽게 고쳐본 소스입니다.
혹 잘 된다면 응용하시면 될 것 같습니다.
ex.
</p>
<p><span>안녕요<span class="s_red">바</span><span class="s_bg_gray">이루</span></span></p>
<p><style>
.s_red {color: red}
.s_bg_gray {background: #e9e9e9; color: #e9e9e9; cursor:pointer}
.s_bg_gray.on {background: transparent; color: #333; cursor:pointer}
</style></p>
<p><script>
$(function() {
$('.s_bg_gray').on('click', function() {
$(this).toggleClass('on');</p>
<p> //$(this).css({'background' : 'transparent', 'color' : '#333'});
});
});
</script> </p>
<p>
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인