css의 이미지에 href를 적용을 어떻게 해야하나요.

css의 이미지에 href를 적용을 어떻게 해야하나요.

QA

css의 이미지에 href를 적용을 어떻게 해야하나요.

답변 1

본문

#house_right{position:fixed;top:45%;right:135px;background:#fff;width:194px;height:228px; background:url(../images/right_ban.png) no-repeat;text-indent:-9999px;overflow:hidden;opacity:0.8}

 

위의 소스에서 이미지를 클릭했을 때 다른 곳으로 이동하게하려고 합니다.

href를 어떻게 적용을 해야하나요? 

감사합니다. 

이 질문에 댓글 쓰기 :

답변 1

#house_right 에 해당하는 태그가 있겠죠.

그것에 링크를 걸면 되겠죠.

예를 들면

<a href="" title=""><div id="house_right">어쩌고 저쩌고</div></a>

또는 jquery를 사용해

<div id="house_right">어쩌고 저쩌고</div>

<script>

$(function() {

    $("#house_right").click(function() {

        location.href = "넘어갈url";

    });

});

</script>

등등 여러 방법들이 있죠.

 

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
filter #href ×
전체 25
© SIRSOFT
현재 페이지 제일 처음으로