학습한 내용
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"
/>
[html]
<div class="animate__animated animate__bounce">Example</div>
<div class="animate__animated animate__bounce animate__faster">Example</div>
<div class="animate__animated animate__bounce animate__slow">Example</div>
<h2 class="color-red">Hello World</h2>
[css]
.color-red {
color: red;
}
.animate__animated {
margin-top: 200px;
margin-left: 200px;
}
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css";
-> 웹 상의 css 파일을 불러온다.
https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.css
-> animate.css의 구조 확인
학습한 내용 중 어려웠던 점 또는 해결 못한 것들
어제 배운 내용 중 부모 자식 태그가 둘 다 relative 일 때 margin-top을 이용한 margin 병합이 왜 일어나지 않는지에 대한 질문을 보고 같은 의문점이 생겼다.
해결 방법 작성
(1) 마진 병합현상 일어나지 않게 하는 방법
overflow:hidden;
속성값을 적용한다. (2) html과 css를 활용하여 확인
[html]
<div class="mario-container">
<div class="mario-coin"></div>
</div>
[css - border 有]
.mario-container {
position: relative;
width: 500px;
height: 500px;
background-color: gray;
border: solid 10px black;
}
.mario-container .mario-coin {
position: relative;
width: 70px;
height: 70px;
background-color: yellow;
border-radius: 50%;
margin-top: 100px;
}
[css - border 無]
.mario-container {
position: relative;
width: 500px;
height: 500px;
background-color: gray;
/*border: solid 10px black;*/
}
.mario-container .mario-coin {
position: relative;
width: 70px;
height: 70px;
background-color: yellow;
border-radius: 50%;
margin-top: 100px;
}
학습 소감
position에 따른 다양한 특성들을 이해하는 것과 확실히 습득하는 것은 차이가 있다고 느꼈다. 코드를 다양하게 바꿔보면서 습득하고자 노력해야겠다.