분류 전체보기
-
script 태그의 위치Note 2021. 3. 29. 16:17
html에서 script 태그는 어디에 위치하는 것이 좋을까? 결론부터 말하면 body 태그 최하단에 위치하는 것이 가장 좋다. 이를 이해하기 위해서는 브라우저 동작 방식을 살펴볼 필요가 있다. 브라우저의 동작 방식 HTML을 읽기 시작 HTML을 파싱 (parsing: 컴퓨터가 읽을 수 있는 코드로 바꾸는 작업) DOM 트리 생성 Render 트리가 생성 (DOM tree + CSS의 CSSOM 트리 결합) Display(브라우저)에 표시 여기서 중요하게 봐야 하는 구간이 1~2의 과정이다. HTML을 읽고 내려가는 과정에서 script를 만나면 파싱은 중단되고, 중단된 상태에서 자바스크립트 코드를 로드 후에 자바스크립트 코드를 파싱하게 된다. 그리고 다시 HTML 파싱이 계속되는 것이다. HTML을 ..
-
[css] 다른 요소에 영향을 주는 hoverNote 2021. 3. 28. 20:14
stackoverflow.com/questions/4502633/how-to-affect-other-elements-when-one-element-is-hovered How to affect other elements when one element is hovered What I want to do is when a certain div is hovered, it'd affect the properties of another div. For example, in this JSFiddle demo, when you hover over #cube it changes the background-color but what I stackoverflow.com 요소가 컨테이너 내부에 직접 있는 경우 #contain..
-
[Codewars] RGB To Hex ConversionAlgorithm 2021. 3. 23. 18:33
www.codewars.com/kata/513e08acc600c94f01000001/train/javascript Codewars: Achieve mastery through challenge Codewars is where developers achieve code mastery through challenge. Train on kata in the dojo and reach your highest potential. www.codewars.com 더보기 The rgb function is incomplete. Complete it so that passing in RGB decimal values will result in a hexadecimal representation being returned..
-
[Codewars] DubstepAlgorithm 2021. 3. 22. 18:55
www.codewars.com/kata/551dc350bf4e526099000ae5/train/javascript Codewars: Achieve mastery through challenge Codewars is where developers achieve code mastery through challenge. Train on kata in the dojo and reach your highest potential. www.codewars.com 더보기 Polycarpus works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. Recently, he has decided to take..