回答編集履歴
3
説明追記
test
CHANGED
@@ -47,6 +47,16 @@
|
|
47
47
|
---
|
48
48
|
|
49
49
|
CSSが提示されたので、それを元に改修。
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
- liには幅を設定しないで子要素の`.page-numbers`に幅を設定
|
54
|
+
|
55
|
+
- 「前へ」`.prev`「次へ」`.next`には上記と異なる幅を設定
|
56
|
+
|
57
|
+
- liに`display: inline-block;`を設定すれば横並びになるので、`position: absolute;`は不要。複雑になるだけ。
|
58
|
+
|
59
|
+
- 冗長な設定が多かったので、それを排除してシンプルに修正。
|
50
60
|
|
51
61
|
|
52
62
|
|
@@ -100,27 +110,25 @@
|
|
100
110
|
|
101
111
|
transition: all 0.3s ease;
|
102
112
|
|
103
|
-
|
113
|
+
&:hover,
|
104
114
|
|
115
|
+
&:active {
|
105
116
|
|
117
|
+
color: #000;
|
106
118
|
|
107
|
-
|
119
|
+
background: #ccf;
|
108
120
|
|
109
|
-
b
|
121
|
+
border-color: #00f;
|
110
122
|
|
111
|
-
}
|
123
|
+
}
|
112
124
|
|
125
|
+
&.current {
|
113
126
|
|
127
|
+
color: #fff;
|
114
128
|
|
115
|
-
|
129
|
+
background: $blue;
|
116
130
|
|
117
|
-
&:active {
|
118
|
-
|
119
|
-
|
131
|
+
}
|
120
|
-
|
121
|
-
background: #ccf;
|
122
|
-
|
123
|
-
border-color: #00f;
|
124
132
|
|
125
133
|
}
|
126
134
|
|
@@ -140,6 +148,4 @@
|
|
140
148
|
|
141
149
|
```
|
142
150
|
|
143
|
-
|
144
|
-
|
145
151
|
[CodePenサンプル](https://codepen.io/hatena19/pen/RwRByKM)
|
2
コード修正
test
CHANGED
@@ -52,6 +52,12 @@
|
|
52
52
|
|
53
53
|
```scss
|
54
54
|
|
55
|
+
$lightblue3: lightblue;
|
56
|
+
|
57
|
+
$blue: blue;
|
58
|
+
|
59
|
+
|
60
|
+
|
55
61
|
.page-numbers {
|
56
62
|
|
57
63
|
text-align: center;
|
@@ -80,7 +86,7 @@
|
|
80
86
|
|
81
87
|
color: #fff;
|
82
88
|
|
83
|
-
background: lightblue;
|
89
|
+
background: $lightblue3;
|
84
90
|
|
85
91
|
border-radius: 10px;
|
86
92
|
|
@@ -100,7 +106,7 @@
|
|
100
106
|
|
101
107
|
>.current {
|
102
108
|
|
103
|
-
background: blue;
|
109
|
+
background: $blue;
|
104
110
|
|
105
111
|
}
|
106
112
|
|
1
コード追記
test
CHANGED
@@ -41,3 +41,99 @@
|
|
41
41
|
}
|
42
42
|
|
43
43
|
```
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
---
|
48
|
+
|
49
|
+
CSSが提示されたので、それを元に改修。
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
```scss
|
54
|
+
|
55
|
+
.page-numbers {
|
56
|
+
|
57
|
+
text-align: center;
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
>li {
|
62
|
+
|
63
|
+
margin: 0 2px;
|
64
|
+
|
65
|
+
padding: 0;
|
66
|
+
|
67
|
+
display: inline-block;
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
>.page-numbers {
|
72
|
+
|
73
|
+
width: 50px;
|
74
|
+
|
75
|
+
height: 50px;
|
76
|
+
|
77
|
+
display: table-cell;
|
78
|
+
|
79
|
+
vertical-align: middle;
|
80
|
+
|
81
|
+
color: #fff;
|
82
|
+
|
83
|
+
background: lightblue;
|
84
|
+
|
85
|
+
border-radius: 10px;
|
86
|
+
|
87
|
+
text-decoration: none;
|
88
|
+
|
89
|
+
-webkit-transition: all 0.3s ease;
|
90
|
+
|
91
|
+
-moz-transition: all 0.3s ease;
|
92
|
+
|
93
|
+
-o-transition: all 0.3s ease;
|
94
|
+
|
95
|
+
transition: all 0.3s ease;
|
96
|
+
|
97
|
+
}
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
>.current {
|
102
|
+
|
103
|
+
background: blue;
|
104
|
+
|
105
|
+
}
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
&:hover,
|
110
|
+
|
111
|
+
&:active {
|
112
|
+
|
113
|
+
color: #000;
|
114
|
+
|
115
|
+
background: #ccf;
|
116
|
+
|
117
|
+
border-color: #00f;
|
118
|
+
|
119
|
+
}
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
>.prev,
|
124
|
+
|
125
|
+
>.next {
|
126
|
+
|
127
|
+
width: 80px;
|
128
|
+
|
129
|
+
}
|
130
|
+
|
131
|
+
}
|
132
|
+
|
133
|
+
}
|
134
|
+
|
135
|
+
```
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
[CodePenサンプル](https://codepen.io/hatena19/pen/RwRByKM)
|