ReasonJun

CSS : transition 본문

Frontend/CSS

CSS : transition

ReasonJun 2023. 6. 6. 12:38
728x90

Shortcut properties that specify the transition effect of an element

transition-property / transition-duration / transition-timing-function / transition-delay

  • transition-property: Specifies the name of the property to use the transition effect for
div {
	width: 100px;
	height: 100px;
	background-color: orange;
	transition: width 1s; => Only the horizontal length changes naturally
}

div:active {
	width: 300px;
	background-color: royalblue
}
  • transition-durtaion: Specifies the duration of the transition effect
div {
	width: 100px;
	height: 100px;
	background-color: orange;
	transition: 
		width .5s,
		background-color 2s; 
}
  • transition-timing-function: Specifies the easing function of the transition effect

https://developer.mozilla.org/en-US/docs/Web/CSS/transition-timing-function

 

transition-timing-function - CSS: Cascading Style Sheets | MDN

The transition-timing-function CSS property sets how intermediate values are calculated for CSS properties being affected by a transition effect.

developer.mozilla.org

  • transition-delay: Specifies how many seconds to wait for the transition effect to start
div {
	width: 100px;
	height: 100px;
	background-color: orange;
	transition: 1s .5s; => It runs after 0.5 seconds.
}
728x90

'Frontend > CSS' 카테고리의 다른 글

CSS : media  (0) 2023.06.06
CSS : Animation  (0) 2023.06.06
CSS : Stack order / flex  (0) 2023.06.05
CSS : position  (0) 2023.06.05
CSS : display / opacity / font / character / background  (0) 2023.06.05
Comments