전체 글

CSS

[CSS] 글자 가운데 맞추기

1. 한줄일 경우 팁 div { width: 200px; height: 100px; border: 1px solid; background: yellow; text-align: center; line-height: 100px; box-sizing: border-box;}line-height: 100px; 와 heigth 높이 를 같이 맞쳐서 글자가 원래 박스 맨윗부분에 붙으려는 성질을 높이의 정중앙에 배치하려는 성질 이용-두줄일때 정중앙 배치가 깨짐 2.flex 박스 이용div { display: flex; justify-content: center; /* 가로 가운데 */ align-items: center; /* 세로 가운데 */ height: 100px;}한줄이든 두줄이든 ..

git

git 계정 ssh The agent has no identities. error: src refspec main does not match any error: failed to push some refs

어제 새로운 깃허브 계정을 생성하고 ssh 키생성하고 - 깃허브 계정에 ssh키등록도 마치고 로그인이 하고 커밋 푸쉬까지 잘 넣은걸 확인했다 다음날 다시 새로운 레파지토리가 필요해서 리모트를 연결하는데 잘 되지 않았다 error: src refspec main does not match any error: failed to push some refs t... 현 ssh-agent가 들고있는 키목록확인ls -al ~/.ssh키목록에는 어제 생성한 id.pub가 있었고 실제 키 로 대조 해본결과 깃허브설정에 등록되 어있는 키내용과도 같았다ssh-keygen -lf ~/.ssh/id_.pub ~/.ssh/config 때문에 엉뚱한 키/옵션이 적용되는지 확인해보니cat ~/.ssh/config이전..

React

[React] ❌ TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'

🥹 api request 테스터를 하던중 위와 같은 문제가 발생했다api요청으로 데이터가 잘 넘어오는지 확인하기 위해 기존에 로컬 더미로 꾸며진 html 태그는모두 주석처리한상태 async render() { console.log('🎨 ProductGrid 렌더링 시작'); try { console.log('📦 ProductGrid 렌더링 시작'); const response = await this.apiManager.getProducts(); console.log(`✅ ProductGrid 렌더링 완료 : ${response}`); this.product = response?.results ?? []; this.createElement(); ..

알고리즘/JavaScript

[Javascript] 순서 바꾸기

🏈Javascriptfunction solution(num_list, n) { const part2 = num_list.slice(n, num_list.lenght); const part1 = num_list.slice(0,n); return [...part2,...part1]} 🔹... 스프레드 연산자 => 여러 배열을 합치기 => 새로운 배열 반환🔹속성을 덮어쓰거나 추가하거나 수정가능(ES6(ECMAScript 2015)에서 도입된 문법) 🔹concat() -> 배열끼리도 합치기는 게가능const numbers = [1, 2];const result1 = numbers.concat(3, 4);console.log(result1); // 출력: [1, 2, 3,..

여미미
guide