File tree Expand file tree Collapse file tree 1 file changed +50
-3
lines changed
Expand file tree Collapse file tree 1 file changed +50
-3
lines changed Original file line number Diff line number Diff line change 33< head >
44 < meta charset ="UTF-8 ">
55 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6- < title > Simple HTML Page</ title >
6+ < title > Interactive HTML Page</ title >
77 < style >
88 body {
99 font-family : Arial, sans-serif;
1010 text-align : center;
1111 margin : 50px ;
12+ background-color : # f9f9f9 ;
1213 }
1314 h1 {
1415 color : # 4CAF50 ;
1718 font-size : 18px ;
1819 color : # 555 ;
1920 }
21+ .button-container {
22+ margin-top : 20px ;
23+ }
24+ button {
25+ background-color : # 4CAF50 ;
26+ color : white;
27+ border : none;
28+ padding : 10px 20px ;
29+ font-size : 16px ;
30+ border-radius : 5px ;
31+ cursor : pointer;
32+ margin : 10px ;
33+ transition : background-color 0.3s , transform 0.2s ;
34+ }
35+ button : hover {
36+ background-color : linear-gradient (90deg , # 45a049, # 32a89f );
37+ transform : scale (1.05 );
38+ }
39+ a {
40+ text-decoration : none;
41+ }
2042 </ style >
2143</ head >
2244< body >
23- < h1 > Welcome to My Page</ h1 >
24- < p > This is a simple HTML example. Feel free to modify and expand it!</ p >
45+ < h1 > Welcome to My Github</ h1 >
46+ < p > This is a guide</ p >
47+ < div class ="button-container ">
48+ <!-- 按钮1:弹出提示框 -->
49+ < button onmouseover ="changeColor(this) " onmouseout ="resetColor(this) " onclick ="showMessage() "> Show Message</ button >
50+
51+ <!-- 按钮2:跳转到另一个网页 -->
52+ < a href ="https://danielchen3.github.io/usa_map " target ="_blank ">
53+ < button onmouseover ="changeColor(this) " onmouseout ="resetColor(this) "> Go to Map</ button >
54+ </ a >
55+ </ div >
56+
57+ < script >
58+ function showMessage ( ) {
59+ alert ( 'Hello! This is a Heat Alert Warning!' ) ;
60+ }
61+
62+ // 改变按钮背景色
63+ function changeColor ( button ) {
64+ button . style . background = 'linear-gradient(90deg, #45a049, #32a89f)' ;
65+ }
66+
67+ // 恢复按钮背景色
68+ function resetColor ( button ) {
69+ button . style . background = '#4CAF50' ;
70+ }
71+ </ script >
2572</ body >
2673</ html >
You can’t perform that action at this time.
0 commit comments