Coding/HTML+CSS 11

[CSS] display: flex 사용시 자식의 영역을 width로 갖는 법

display: flex;가 선언된 태그는 자식들의 영역이 아닌 부모의 영역을 width로 갖게 된다. 예시 1 2 3 4 5 6 7 8 9 10 .container { width: 320px; } .test-list { display: flex; align-items: center; } a { width: 50px; } 위 코드의 경우 display: flex;가 선언된 .test-list는 width 값이 부모인 .container의 width인 320px을 width로 가진다. a태그가 자기 영역을 온전히 차지할 수 있도록 a태그에 flex-shrink: 0;을 붙여줘도 .test-list의 width는 여전히 320px이다. 그렇다면 .test-list가 flex의 기능을 수행하면서 자식의 wid..

Coding/HTML+CSS 2022.02.24

[HTML] SVG 사용하기 (폰트 적용 / 직접 그리기)

1. SVG 파일 첨부 https://icomoon.io/app/#/select 에서 Generate Font를 사용하여 svg파일을 폰트로 변경하면, fontawesome에서 제공하는 아이콘처럼 태그로 첨부할 수 있다. 2. SVG 직접 그리기 (1) 기본 도형 태그 : 사각형 : 원 : 타원 : 선 : 다각형 (자동닫힘 x) : 다각형 (자동닫힘 o) See the Pen Untitled by Seonu (@parkseonup) on CodePen. (2) Path 태그 : 일러스트레이터 펜툴과 유사한 그리기 속성 d="" 선언시 드로잉 시작 See the Pen Untitled by Seonu (@parkseonup) on CodePen.

Coding/HTML+CSS 2022.02.14

[CSS] justify-content: flex-end 속성이 안 먹는 이유

이미지 슬라이드를 반응형으로 짜는 중에 슬라이드 이전 버튼을 클릭할 시 justify-content: flex-end;를 사용하여 정렬을 전환해야 했는데, 기존 코드로는 justify-content: flex-end; 가 작동하지 않았다. 기존 코드↓ 1 2 3 4 5 이전 다음 * { padding: 0; margin: 0; } body { display: flex; justify-content: center; align-items: center; width: 100%; height: 100vh; } section { max-width: 400px; width: 100%; height: 400px; } div { position: relative; display: flex; width: 100%; he..

Coding/HTML+CSS 2021.12.29

[CSS] img 사이즈 조절 시 흐려지는 현상

로고 등 보다 선명한 화질을 위해 웹사이트에 출력될 사이즈보다 큰 이미지를 삽입할 경우, css값으로 이미지를 축소시키면 이미지가 흐려보이는 현상이 있음. 해당하는 이미지의 렌더링 방식을 css에서 변경해주면 해결됨 img { image-rendering: -moz-crisp-edges; image-rendering: -o-crisp-edges; image-rendering: -webkit-optimize-contrast; -ms-interpolation-mode: nearest-neighbor; image-rendering: crisp-edges; }

Coding/HTML+CSS 2021.12.21