teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

回答編集

2020/08/04 00:07

投稿

Jon_do
Jon_do

スコア1373

answer CHANGED
@@ -1,17 +1,143 @@
1
- サブテキストをリンクボタンにしたいという意味しょうか?
1
+ 回答編集まし。指定の通りの並び順
2
- それでしたら該当箇所下記のように変えることで可能です。
2
+ リンククリックすることでグーグルに飛ぶようになっています。
3
3
  ```HTML
4
+ <!DOCTYPE html>
5
+ <html lang="ja">
6
+
7
+ <head>
8
+ <meta charset="UTF-8">
4
- <p class="toptext">見出しテキスト<b>サブテキスト</b><a harf="#">サブテキスト</a></p>
9
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
10
+ <title>Document</title>
11
+ <style>
12
+ .glitch {
13
+ position: relative;
14
+ width: 100%;
15
+ height: 70vh;
16
+ }
17
+
18
+ .glitch:before {
19
+ content: '';
20
+ position: absolute;
21
+ top: 0;
22
+ left: 0;
23
+ width: 100%;
24
+ height: 100%;
25
+ opacity: .5;
26
+ mix-blend-mode: hard-light;
27
+ animation: glitch2 2s linear infinite;
28
+ }
29
+
30
+ .glitch:hover:before {
31
+ animation: glitch1 1s linear infinite;
32
+ }
33
+
34
+ @keyframes glitch1 {
5
- ```
35
+ 0% {
36
+ background-position: 0 0;
37
+ filter: hue-rotate(0deg);
38
+ }
39
+
40
+ 10% {
41
+ background-position: 5px 0;
42
+ }
43
+
44
+ 20% {
45
+ background-position: -5px 0;
46
+ }
47
+
48
+ 30% {
49
+ background-position: 15px 0;
50
+ }
51
+
52
+ 40% {
53
+ background-position: -5px 0;
54
+ }
55
+
56
+ 50% {
57
+ background-position: -25px 0;
58
+ }
59
+
60
+ 60% {
61
+ background-position: -50px 0;
62
+ }
63
+
64
+ 70% {
65
+ background-position: 0 -20px;
66
+ }
67
+
68
+ 80% {
69
+ background-position: -60px -20px;
70
+ }
71
+
72
+ 81% {
73
+ background-position: 0 0;
74
+ }
75
+
6
- ```css
76
+ 100% {
77
+ background-position: 0 0;
78
+ filter: hue-rotate(360deg);
79
+ }
80
+ }
81
+
82
+ @keyframes glitch2 {
83
+ 0% {
84
+ background-position: 0 0;
85
+ filter: hue-rotate(0deg);
86
+ }
87
+
88
+ 10% {
89
+ background-position: 15px 0;
90
+ }
91
+
92
+ 15% {
93
+ background-position: -15px 0;
94
+ }
95
+
96
+ 20% {
97
+ filter: hue-rotate(360deg);
98
+ }
99
+
100
+ 25% {
101
+ background-position: 0 0;
102
+ filter: hue-rotate(0deg);
103
+ }
104
+
105
+ 100% {
106
+ background-position: 0 0;
107
+ filter: hue-rotate(0deg);
108
+ }
109
+ }
110
+
111
+ .toptext {
112
+ color: black;
113
+ width: 30%;
114
+ max-width: 220px;
115
+ position: relative;
116
+ margin: 0 auto;
117
+ padding: 0;
118
+ }
119
+
7
- .toptext a {
120
+ .toptext b {
8
121
  display: inline-block;
122
+ color: white;
9
- opacity: 0;
123
+ background: #000;
10
124
  padding: 5px;
11
125
  margin-top: 7px;
12
126
  letter-spacing: 0.3em;
13
- position: absolute;
14
- bottom: 0;
15
- left: 0;
16
127
  }
128
+
129
+ .toptext a {
130
+ border: 2px solid #fff;
131
+ text-align: center;
132
+ display: inline-block;
133
+ margin-top: 15px;
134
+ }
135
+ </style>
136
+ </head>
137
+
138
+ <body>
139
+ <p class="toptext">見出しテキスト<b>サブテキスト</b><a href="https://www.google.com/">リンクボタン</a></p>
140
+ </body>
141
+
142
+ </html>
17
143
  ```