[TIL] 링크 새탭열기, 그냥 열기

Captainjack·2021년 6월 25일
0

TIL

목록 보기
161/258

HTML 그냥 열기

네이버로 바로이동

<button type="button" onclick="location.href='http://www.naver.com' ">네이버로 바로이동</button>

HTML 새창열기

네이버 새탭으로 열기

<button type="button" onclick="window.open(http://www.naver.com) ">네이버 새탭으로 열기</button>

그냥 a href 문에서 새탭 연결하기

<a href='https://www.naver.com' target='_blank'> 나는 하이퍼링크다.</a>


a태그 파란색 없애기 및 기타 등등

<HEAD>
<TITLE> 링크에 밑줄 없애기 </TITLE>

<style type="text/css">
 a:link { color: red; text-decoration: none;}
 a:visited { color: black; text-decoration: none;}
 a:hover { color: blue; text-decoration: underline;}
</style>
  • 해 석 -
    style 소스의 type = text를 제어하는 css로 한다.
    a:link : 클릭하지 않은 링크
    a:visited : 한번 클릭했던 혹은 다녀갔던 링크
    a:hover : 링크를 클릭하려고 마우스를 가져갔을 때
    decoration : 밑줄
    none : 없는 상태
    underline : 있는 상태

a:active : 링크부분에서 마우스를 누르고 있는 동안의 상태

출처: https://storyhong.tistory.com/82

css에서 옵션을 주기


a {text-decoration: none;}

원래 파란 깃헙 고양이가 하얗게 잘 나옴 해결!


profile
til' CTF WIN

0개의 댓글