回答編集履歴

3

ミス修正

2018/09/17 06:26

投稿

spookybird
spookybird

スコア1803

test CHANGED
@@ -54,9 +54,9 @@
54
54
 
55
55
  width: 50px;
56
56
 
57
- height: 50px;: 50%;
57
+ height: 50px;
58
58
 
59
- border-radius
59
+ border-radius: 50%;
60
60
 
61
61
  overflow: hidden;
62
62
 

2

IE11用追記

2018/09/17 06:26

投稿

spookybird
spookybird

スコア1803

test CHANGED
@@ -21,3 +21,55 @@
21
21
 
22
22
 
23
23
  IE11でやろうと思うとちょっと面倒くさいかもしれません。
24
+
25
+
26
+
27
+ ### ご要望にお応えして追記
28
+
29
+
30
+
31
+ IE11だとこうすればいけると思います。
32
+
33
+ CSSのみでやる方法は、もしかするとあるかもしれませんがちょっと思いつきませんでした。
34
+
35
+
36
+
37
+ ```html
38
+
39
+ <div class="icon">
40
+
41
+ <img src="********" />
42
+
43
+ </div>
44
+
45
+ ```
46
+
47
+
48
+
49
+ ```css
50
+
51
+ .icon {
52
+
53
+ position: relative;
54
+
55
+ width: 50px;
56
+
57
+ height: 50px;: 50%;
58
+
59
+ border-radius
60
+
61
+ overflow: hidden;
62
+
63
+ }
64
+
65
+ .icon > img {
66
+
67
+ position: absolute;
68
+
69
+ top: calc(50% - 25px);
70
+
71
+ left: calc(50% - 45px);
72
+
73
+ }
74
+
75
+ ```

1

ミス修正

2018/09/17 06:24

投稿

spookybird
spookybird

スコア1803

test CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ```css
6
6
 
7
- img {
7
+ img.icon {
8
8
 
9
9
  width: 50px;
10
10