728x90
반응형
SMALL
1. 팝업뜨게 하는 법 : openpopup
<a class="button minsobabo" onclick="openPopup('xxxx.html')"> 바로가기</a>
<script>
/* 생략 function openPopup(url) {
window.open(url, "PopupWindow", "width=600,height=400,scrollbars=yes");
} */
</script>
<style></style>
</head>
<body>
<div class="button-container">
<a class="button minsobabo" onclick="window.open('웹주소입력')">버튼이름</a>
</div>
2. URL 뜨게하는 법: window.open
<a class="button minsobabo" onclick="window.open(URL주소를 입력하세요)"> 바로가기</a>
<script>
function openPopup(url) {
window.open(url, "PopupWindow", "width=600,height=400,scrollbars=yes");
}
</script>
<style></style>
</head>
<body>
<div class="button-container">
<a class="button minsobabo" onclick="openPopup('특정파일.html')">버튼이름</a>
</div>
- 전체 코드 예시
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>웰컴 투 ㅇㅇㅇㅇ</title>
<script>
function openPopup(url) {
window.open(url, "PopupWindow", "width=600,height=400,scrollbars=yes");
}
</script>
<style></style>
</head>
<body>
<div class="button-container">
<a class="button minsobabo" onclick="window.open('웹주소입력')">버튼이름</a>
<a class="button minsobabo" onclick="openPopup('특정파일.html')">버튼이름</a>
</div>
</body>
</html>
728x90
반응형
LIST
'개발 > html' 카테고리의 다른 글
#6. 버튼(class)에 효과 주기 - 버튼 장식 및 효과 (0) | 2024.06.22 |
---|---|
#5. 버튼(class)에 효과 주기 - 버튼크기 및 레이아웃 (0) | 2024.06.22 |
#4. 버튼(class)에 효과 주기 - 기본 스타일링(테두리,텍스트) (0) | 2024.06.22 |
#3. 버튼(class)에 효과 주기 - 기본 스타일링(색상) (0) | 2024.06.22 |
#1. 파비콘 설정하기(이미지로 설정) (0) | 2024.06.22 |