css fallback for IE(11+)
我也不知道我當初為什麼會硬著頭皮寫英文的,反正就是英文的了哈哈哈
1. grayscale
|
|
- use javascript. see tutorial here.
- or just simply use picture in gray. (haha)
2. object-fit / object-position
|
|
- IE doesn’t support
object-fit
after IE10,
so usebackground-size
andbackground-position
instead.
3. vertical centering with css translate
As the question asked here,
when using css translate to center contents,
after scrolling the webpage, IE would somehow translate dom elements in the way that were not expected.
This is what i encountered:
The original page looks like this.
After scrolling to other section(with jquery), the first section was “moved up”.
The html and css:
|
|
I found out it’s the css in .page-content
that caused the unexpected translation (in IE only of course),
so after using bottom
and right
instead of top
and right
as suggested,
everything works fine magically again!
|
|
Guess this is just some kind of bug in IE, since this doesn’t happen in other browsers. Stupid IE.