CSS Articles

Page 119 of 130

Fade In Tooltip with CSS Animation

Nitya Raut
Nitya Raut
Updated on 24-Jun-2020 465 Views

To fade in tooltip text with CSS, you can try to run the following code: Example        .mytooltip .mytext {       visibility: hidden;       width: 140px;       background-color: blue;       color: #fff;       z-index: 1;       top: -5px;       right: 110%;       text-align: center;       border-radius: 6px;       padding: 5px 0;       position: absolute;       opacity: 0;       transition: opacity 1s;     }     .mytooltip {       position: relative;       display: inline-block;       margin-left: 150px;     }     .mytooltip .mytext:after {       content: "";       position: absolute;       top: 50%;       left: 100%;       margin-top: -5px;       border-width: 6px;       border-style: solid;       border-color: transparent transparent transparent blue;     }     .mytooltip:hover .mytext {       visibility: visible;       opacity: 1;     }           Keep mouse cursor over me        My Tooltip text        

Read More

Usage of transform property with CSS

Vrundesha Joshi
Vrundesha Joshi
Updated on 24-Jun-2020 105 Views

The transform property in CSS is used to apply a 2D or 3D transformation to an element. You can try to run the following code to implement the transform property − Example             div {        width: 200px;        height: 100px;        background-color: gray;        transform: rotate(10deg);      }              Rotation    Demo   

Read More

Selects every <ul> element that are preceded by a <p> element with CSS

Arjun Thakur
Arjun Thakur
Updated on 24-Jun-2020 2K+ Views

Use the element ~ element selector to select elements preceded by element. You can try to run the following code to implement this Example             p~ul {       color: white;       background-color: blue;      }              Demo Website    Fruits          Vegetables are good for health.             Spinach       Onion       Capsicum              Fruits are good for health.          Apple      Orange      Kiwi       

Read More

Set top tooltip with CSS

Nishtha Thakur
Nishtha Thakur
Updated on 24-Jun-2020 212 Views

To set-top tooltip, use the bottom CSS property. You can try to run the following code to set-top tooltip to a text: Example        .mytooltip .mytext {       visibility: hidden;       width: 140px;       background-color: blue;       color: #fff;       z-index: 1;       bottom: 100%;       left: 60%;       margin-left: -90px;       text-align: center;       border-radius: 6px;       padding: 5px 0;       position: absolute;     }     .mytooltip {       position: relative;       display: inline-block;       margin-top: 50px;     }     .mytooltip:hover .mytext {       visibility: visible;     }           Keep mouse cursor over me        My Tooltip text        

Read More

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

Arjun Thakur
Arjun Thakur
Updated on 24-Jun-2020 141 Views

Use the animation-fill-mode property to set a style for the element when the animation is not playing Example             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;}      }                 

Read More

Selects all <p> elements that are placed immediately after <div> elements with CSS

Arjun Thakur
Arjun Thakur
Updated on 24-Jun-2020 381 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, Example             div + p {        color: white;        background-color: blue;      }              Demo Website    Fruits          This is demo text.        Fruits are good for health.    Fruits makes you healthy.   

Read More

Shorthand property to set all the animation properties with CSS

Krantik Chavan
Krantik Chavan
Updated on 24-Jun-2020 208 Views

The shorthand property to set all the animation properties is animation. It sets the animation duration, animation name, etc. You can try to run the following code to work with animation shorthand property: Example               div {         width: 150px;         height: 200px;         background-color: yellow;         animation: myanim 2s;       }       @keyframes myanim {         from {           background-color: green;         }         to {           background-color: blue;         }       }                   

Read More

Create a sticky navbar with CSS

Nancy Den
Nancy Den
Updated on 24-Jun-2020 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, Example                     ul {             list-style-type: none;             position: sticky;             overflow: hidden;             top: 0;             width: 100%;          }          li {             float: left;             border-right: 1px solid white;          }          li a {             display: block;             padding: 8px;             background-color: orange;          }          li:last-child {             border-right: none;          }          div {             padding:5px;             margin-top:5px;             background-color:white;             height:1000px;          }                                Home          News          Contact          About                        Adding demo text to check fixed menu.          Adding demo text to check fixed menu.          Adding demo text ...

Read More

CSS transition-duration property

Arjun Thakur
Arjun Thakur
Updated on 24-Jun-2020 101 Views

Use the transition-duration property to set the duration of transition Example             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.       

Read More

Build a radial gradient with the shape of a circle

Arjun Thakur
Arjun Thakur
Updated on 23-Jun-2020 274 Views

To create a circle with radial gradient, you can try to run the following code. Set another parameter in radial gradient for shapes like circle Example             #demo {       height: 400px;       background: radial-gradient(circle, red , blue, yellow);      }              Radial Gradient    Radial Gradients   

Read More
Showing 1181–1190 of 1,299 articles
« Prev 1 117 118 119 120 121 130 Next »
Advertisements