Found 1594 Articles for CSS

Set a CSS style for the element when the animation is not playing

Arjun Thakur
Updated on 24-Jun-2020 06:35:03

115 Views

Use the animation-fill-mode property to set a style for the element when the animation is not playingExampleLive Demo                    div {             width: 150px;             height: 200px;             position: relative;             background: red;             animation-name: myanim;             animation-duration: 2s;             animation-fill-mode: backwards;          }          @keyframes myanim {             from {left: 0px; background-color: green;}             to {left: 200px; background-color: blue;}          }                        

Selects all elements with CSS

Chandu yadav
Updated on 24-Jun-2020 06:33:47

264 Views

To select all elements, use the * CSS Selector. You can try to run the following code to select all the elements,ExampleLive Demo                    *{             color: blue;             background-color: orange;          }                     Demo Website       Learning       Tutorials on web dev, programming, database, networking, etc.       Every tutorials has lessons with illustrations and figures.    

Select elements whose attribute value begins with a specified value with CSS

Ankith Reddy
Updated on 24-Jun-2020 06:33:03

178 Views

To select elements whose attribute value begins with a specified value, use the [attribute^=”value”] selectorYou can try to run the following code to implement the [attribute^=”value”] selector,ExampleLive Demo                    [alt^=Tutor] {             border: 5px solid blue;             border-radius: 5px;          }                              

Selects the element with id="tutorials" with CSS

Nancy Den
Updated on 24-Jun-2020 06:32:27

159 Views

To select all the elements with id=”tutorials”, you can try to run the following code.Use the #id CSS selector to achieve this,ExampleLive Demo                    #tutorials {             border: 3px solid red;          }                     Tutorialspoint       Learning       Tutorials on web dev, programming, database, networking, etc.       Every tutorials has lessons with illustrations and figures.    

Set animation with a slow end using CSS

Chandu yadav
Updated on 24-Jun-2020 06:29:58

831 Views

Use the animation-timing-function property, with the ease-out value to set animation with a slow end with CSSExampleLive Demo                    div {             width: 150px;             height: 200px;             position: relative;             background-color: #808000;             animation-name: myanim;             animation-duration: 2s;             animation-direction: alternate-reverse;             animation-iteration-count: 3;          }          @keyframes myanim {             from {left: 100px;}             to {left: 200px;}          }          #demo {animation-timing-function: ease-out;}                     ease-out effect    

Selects all elements that are placed immediately after

Arjun Thakur
Updated on 24-Jun-2020 06:26:54

335 Views

Use the element+element selector to select elements placed after first specified element. You can try to run the following code to implement this,ExampleLive Demo                    div + p {             color: white;             background-color: blue;          }                     Demo Website       Fruits                This is demo text.             Fruits are good for health.       Fruits makes you healthy.    

Selects all elements where the parent is a

Daniol Thomas
Updated on 24-Jun-2020 06:27:50

669 Views

Use the element > element selector to select an element with a parent element.You can try to run the following code to select all elements where the parent is a element,ExampleLive Demo                    div > p {             color: white;             background-color: blue;          }                     Demo Website       Fruits       Fruits are good for health.                This is demo text.          

Set an animation with the same speed from start to end with CSS

Ankith Reddy
Updated on 24-Jun-2020 06:20:20

259 Views

Use the animation-timing-function property, with the linear value to set animation with the same speed from start to end with CSSExampleLive Demo                    div {             width: 150px;             height: 200px;             position: relative;             background-color: yellow;             animation-name: myanim;             animation-duration: 2s;             animation-direction: alternate-reverse;             animation-iteration-count: 3;          }          @keyframes myanim {             from {left: 100px;}             to {left: 200px;}          }          #demo {animation-timing-function: linear;}                     linear effect    

Set whether an animation should be played forwards or using CSS

Nancy Den
Updated on 24-Jun-2020 06:17:12

150 Views

Use the animation-direction property to set whether an animation should be played forwards, backward or in alternate cycles:ExampleLive Demo                    div {             width: 150px;             height: 200px;             background-color: yellow;             animation-name: myanim;             animation-duration: 2s;             animation-direction: reverse;          }          @keyframes myanim {             from {                background-color: green;             }             to {                background-color: blue;             }          }                        

Set a delay for the start of an animation with CSS

radhakrishna
Updated on 24-Jun-2020 06:16:26

168 Views

Use the animation-delay property to set a delay for the start of an animation with CSS:ExampleLive 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;             }          }                        

Advertisements