티스토리 뷰
웹 외주 프로젝트를 진행하다가 난관에 봉착했습니다..
(웹은 처음이라,,,)
chrome으로는 잘 적용되던 것들이 IE에서는 호환이 안되는 것!
아무리 2022년 6월에 IE 서비스를 종료한다고 해도
이 부분은 고객사와의 약속이니만큼 최선을 다해 호환성을 맞추려 끙끙 댔습니다.
분명 다른 분들도 저와 비슷항 상황을 겪고 있을거라 생각하여
참고해보시라 적어봅니다!!!
이 사이트는 chrome에서 잘 돌아가는 css를 IE에서도 호환이 되게 자동으로 변경해주는 사이트입니다!
https://autoprefixer.github.io
Autoprefixer CSS online
include comment with configuration to the result Select result Autoprefixer online — web repl for original Autoprefixer. It parses your CSS and adds vendor prefixes to CSS rules using values from Can I Use. It is recommended by Google and used by Twitter
autoprefixer.github.io
일단 원래 제가 쓰려고 하던 html 구조가
ul > li 이렇게 되어있고
<ul>이 grid의 바깥 테두리 부분이고, <li>가 grid 안쪽의 한 아이템, 아이템 요렇게 구성되어 있습니다!
<ul>에는 기존 css를 상단 Autoprefixer CSS online 사이트에 돌려서 수정된
.test-grid ul{
display: -ms-grid;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(21%, auto));
-ms-grid-columns: 100px 100px 100px 100px;
justify-items: start;
-ms-flex-line-pack: start;
align-content: flex-start;
width: 100%;
height: -webkit-fit-content;
height: -moz-fit-content;
height: fit-content;
-webkit-padding-start: 0px;
padding-inline-start: 0px;
margin-bottom: 0;
}
를 적용해 주었고 ,
row-gap같은 속성들이 IE에서는 안먹어서 <li>에 직접 마진을 설정해주어야 합니다!!!!!!!!!!!!!
그리고 중요한점,,!
.test-grid ul > *:nth-child(1) {
-ms-grid-row: 1;
-ms-grid-column: 1;
}
.test-grid ul > *:nth-child(2) {
-ms-grid-row: 1;
-ms-grid-column: 2;
}
.test-grid ul > *:nth-child(3) {
-ms-grid-row: 1;
-ms-grid-column: 3;
}
.test-grid ul > *:nth-child(4) {
-ms-grid-row: 1;
-ms-grid-column: 4;
}
...
이렇게 ul에
1번째 아이템의 위치는 1행 1열,
2번째 아이템의 위치는 1행 2열,
3번째 아이템의 위치는 1행 3열,
4번째 아이템의 위치는 1행 4열
...
아이템의 행과 열을 지정해주어야 합니다!
(이 부분을 안해주게 되면 모든 아이템들이 1행 1열에 모입니다!!)
이렇게만 하면 grid가 잘 적용되는 것을 볼 수 있습니다!
(+ 참고로 fit-content가 IE에서는 지원이 안됩니다!
height: fit-content;
를 쓰고싶다면?
height: -webkit-fit-content;
height: -moz-fit-content;
height: fit-content;
요렇게 세줄 다 써주면 됩니다!)
(참고 사이트 : https://www.codingfactory.net/12419 작성자님 감사합니다ㅠㅠ!)
'Web' 카테고리의 다른 글
[React] 반응형 웹 (Media Query, react-responsive) (0) | 2022.09.18 |
---|---|
[React] component, page transition, redux, styled component (0) | 2022.08.29 |
[React] React 개발은 할 줄 아는데 뭔지는 제대로 몰라서 (0) | 2022.07.31 |
[Web][Canvas] 웹에서 클릭을 감지하여 회전하는 도형 만들기 (0) | 2021.10.27 |
[react.js] mac에서 node-sass때문에 npm install, npm start가 안되는 경우 (0) | 2021.06.21 |
- Total
- Today
- Yesterday
- 로깅
- 인프라
- github action
- ECS
- VPC
- subnet
- springboot
- EC2
- AWS
- ALB
- Grafana
- javascript
- LOKI
- react
- html
- Hook
- 리액트
- js
- SG
- 서버
- Workflow
- ci/cd
- Grafana Alert
- redux
- Docker
- CSS
- RDS
- Service
- 모니터링
- ecr
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |