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

質問編集履歴

1

ページ

2021/03/06 12:30

投稿

hcj---611
hcj---611

スコア2

title CHANGED
File without changes
body CHANGED
@@ -1,4 +1,132 @@
1
+ ``<!DOCTYPE>
2
+ <html lang="ja">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>EXAMPLE</title>
6
+ <style>
7
+ body{font-family: "Century Gothic", 'Lato', sans-serif;}
8
+ a {text-decoration: none;}
9
+ .et-hero-tabs,
10
+ .et-slide {
11
+ display: flex;
12
+ flex-direction: column;
13
+ justify-content: center;
14
+ align-items: center;
15
+ height: 100vh;
16
+ position: relative;
17
+ background: #eee;
18
+ text-align: center;
19
+ padding: 0 2em;
20
+
21
+ h1{font-size: 2rem;
22
+ margin: 0;
23
+ letter-spacing: 1rem;}
24
+
25
+ h3 {font-size: 1rem;
26
+ letter-spacing: 0.3rem;
27
+ opacity: 0.6;}
28
+
29
+ }
30
+
31
+ .et-hero-tabs-container {
32
+ display: flex;
33
+ flex-direction: row;
34
+ position: absolute;
35
+ bottom: 0;
36
+ width: 100%;
37
+ height: 70px;
38
+ box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
39
+ background: #fff;
40
+ z-index: 10;
41
+
42
+ &--top {
43
+ position: fixed;
44
+ top:0;
45
+ }}
46
+
47
+ .et-hero-tab {
48
+ display: flex;
49
+ justify-content: center;
50
+ align-items: center;
51
+ flex: 1;
52
+ color: #000;
53
+ letter-spacing: 0.1rem;
54
+ transition: all 0.5s ease;
55
+ font-size: 0.8rem;
56
+
57
+ &:hover {
58
+ color:white;
59
+ background: rgba(102,177,241,0.8);
60
+ transition: all 0.5s ease;
61
+ }}
62
+
63
+ .et-hero-tab-slider {
64
+ position: absolute;
65
+ bottom: 0;
66
+ width: 0;
67
+ height: 6px;
68
+ background: #66B1F1;
69
+ transition: left 0.3s ease;}
70
+ @media (min-width: 800px) {
71
+ .et-hero-tabs,
72
+ .et-slide {
73
+
74
+ h1 {
75
+ font-size: 3rem;}
76
+ h3 {font-size: 1rem;}
77
+ }
78
+ .et-hero-tab {font-size: 1rem;}
79
+ }
80
+
81
+ </style>
82
+ </head>
83
+ <body>
84
+ <div class="cont">
85
+ <div class="slider"></div>
86
+ <ul class="nav"></div>
87
+ <div data-target='right' class="side-nav side-nav--right"></div>
88
+ <div data-target='left' class="side-nav side-nav--left"></div>
89
+ </div>
90
+ <!-- Hero -->
91
+ <section class="et-hero-tabs">
92
+ <h1>高校</h1>
93
+ <h3>みんなのページ</h3>
94
+ <div class="et-hero-tabs-container">
95
+ <a class="et-hero-tab" href="#tab-es6">1</a>
96
+ <a class="et-hero-tab" href="#tab-flexbox">2</a>
97
+ <a class="et-hero-tab" href="#tab-react">3</a>
98
+ <a class="et-hero-tab" href="#tab-angular">4</a>
99
+ <a class="et-hero-tab" href="#tab-other">5</a>
100
+ <span class="et-hero-tab-slider"></span>
101
+ </div>
102
+ </section>
103
+ <!-- Main -->
104
+ <main class="et-main">
105
+ <section class="et-slide" id="tab-es6">
106
+ <h1>1</h1>
107
+ <h3>something about es6</h3>
108
+ </section>
109
+ <section class="et-slide" id="tab-flexbox">
110
+ <h1>2</h1>
111
+ <h3>something about flexbox</h3>
112
+ </section>
113
+ <section class="et-slide" id="tab-react">
114
+ <h1>3</h1>
115
+ <h3>something about react</h3>
116
+ </section>
117
+ <section class="et-slide" id="tab-angular">
118
+ <h1>4</h1>
119
+ <h3>something about angular</h3>
120
+ </section>
121
+ <section class="et-slide" id="tab-other">
122
+ <h1>5</h1>
123
+ <h3>something about other</h3>
124
+ </section>
125
+ </main>
126
+ </body>
127
+ </html>`
128
+ コード
1
- ホームページ作成時に下記のhtmlを書いたところ、「colon expected」や「{ expected」というエラーが出ました。
129
+ ```ホームページ作成時に下記のhtmlを書いたところ、「colon expected」や「{ expected」というエラーが出ました。
2
130
  このエラーは「●●を要求します」という意味だと思い、{やコロンをつけてみましたが、解決しません。全角スペースを探すと良いと調べたら出てきましたのでやってみましたが、わかりませんでした。
3
131
 
4
132
  尚、<style>の中身はhttps://lab.sonicmoov.com/markup/css/image-slider/のスライド型ナビゲーション Sticky Slider Navigation (Responsive)をコピーし使わせて頂いています。