Found 1566 Articles for CSS

How to delay an animation with CSS

Ankith Reddy
Updated on 24-Jun-2020 05:46:47

74 Views

To delay an animation, use the CSS animation-delay property. You can try to run the following code to delay animationExampleLive Demo                    div {             width: 150px;             height: 200px;             background-color: yellow;             animation-name: myanim;             animation-duration: 2s;             animation-delay: 2s;          }          @keyframes myanim {             from {                background-color: green;             }             to {                background-color: blue;             }          }                        

Selects every element whose href attribute value ends with ".htm" with CSS

mkotla
Updated on 24-Jun-2020 05:47:59

308 Views

Use the [attribute$=”value”] selector to select elements whose attribute value ends with a specified value i.e. “.htm” here.You can try to run the following code to implement the CSS [attribute$="value"] Selector,ExampleLive Demo                    [href$ = htm] {             border: 5px solid orange;             border-radius: 5px;          }                     Java Tutorial       Java Tutorial PDF    

Create a sticky navbar with CSS

Nancy Den
Updated on 24-Jun-2020 05:45:55

2K+ Views

To create a sticky navbar, use the position: sticky; property. You can try to run the following code to create a sticky navbar, ExampleLive Demo                    ul {             list-style-type: none;             position: sticky;             overflow: hidden;             top: 0;             width: 100%;          }          li {             float: left;       ... Read More

CSS transition-timing-function property

George John
Updated on 24-Jun-2020 05:36:48

91 Views

To set up different speed curves with transition-timing-function, you can try to run the following codeExampleLive Demo                    div {             width: 100px;             height: 100px;             background: red;             transition: width 4s;          }          #effect1 {             transition-timing-function: linear;          }          #effect2 {             transition-timing-function: ease-in;          }          #effect3 {             transition-timing-function: ease-out;          }          div:hover {             width: 250px;          }                     Transition Effect       Hover over the div elements and see the transition effect and the speed:       linear effect       ease-in effect       ease-out effect    

Set the name of the CSS property the transition effect is for

seetha
Updated on 24-Jun-2020 05:36:01

67 Views

To set the name of the CSS property the transition effect is, use the CSS transition-property.In the below example, we have set the property as width and set the duration as well:ExampleLive Demo                    div {             width: 150px;             height: 150px;             background: blue;             transition-property: width;             transition-duration: 3s;          }          div:hover {             width: 250px;          }                     Heading One       Hover over the below box to change its width.          

Set how many seconds or milliseconds a CSS transition effect takes to complete

Daniol Thomas
Updated on 02-Jul-2020 08:25:03

205 Views

Use the transition-duration property in CSS to set how many seconds or milliseconds a CSS transition effect takes to complete −ExampleLive Demo                    div {             width: 150px;             height: 150px;             background: blue;             transition-property: height;             transition-duration: 2s;          }          div:hover {             height: 200px;          }                     Heading One       Hover over the below box to change its height.          

CSS transition-duration property

Arjun Thakur
Updated on 24-Jun-2020 05:34:36

95 Views

Use the transition-duration property to set the duration of transitionExampleLive Demo                    div {             width: 150px;             height: 150px;             background: blue;             transition-property: height;             transition-duration: 2s;          }          div:hover {             height: 200px;          }                     Heading One       Hover over the below box to change its height.          

Set a delay for the CSS transition effect

mkotla
Updated on 24-Jun-2020 05:33:49

178 Views

Use the transition-delay property to set a delay for the transition effect with CSS. You can try to run the following code to set a 1-second delay of transition:ExampleLive Demo                    div {             width: 150px;             height: 150px;             background: blue;             transition: width 3s;             transition-delay: 2s;          }          div:hover {             width: 350px;          }                     Heading One       Hover over the below box to change its width. It begins with a delay of 2 seconds.          

CSS Transition property

Krantik Chavan
Updated on 02-Jul-2020 09:18:48

215 Views

Use the CSS transition property to set all the four transition properties into a single line. You can try to run the following code to work with the transition property −ExampleLive Demo                    div {             width: 150px;             height: 150px;             background: blue;             transition: height 3s;          }          div:hover {             height: 250px;          }                     Heading One       Hover over the below box to change its height.          

Usage of CSS transition-delay property

George John
Updated on 24-Jun-2020 05:31:57

63 Views

Use the transition-delay property to delay the transition effect with CSS. You can try to run the following code to set a 1 second delay of transitionExampleLive Demo                    div {             width: 150px;             height: 150px;             background: blue;             transition: width 3s;             transition-delay: 1s;          }          div:hover {             width: 250px;          }                     Heading One       Hover over the below box to change its width. It begins with a delay of 1 second.          

Advertisements