Found 1566 Articles for CSS

Usage of transform property with CSS

Vrundesha Joshi
Updated on 24-Jun-2020 07:14:13

97 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 −ExampleLive Demo                    div {             width: 200px;             height: 100px;             background-color: gray;             transform: rotate(10deg);          }                     Rotation       Demo    

Selects every

Arjun Thakur
Updated on 24-Jun-2020 07:12:49

2K+ Views

Use the element ~ element selector to select elements preceded by element. You can try to run the following code to implement thisExampleLive Demo                    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          

Selects all elements inside

George John
Updated on 24-Jun-2020 07:08:44

3K+ Views

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

Selects all

Ankith Reddy
Updated on 24-Jun-2020 07:04:40

187 Views

To style, more than one element, use a comma. Separate each element with the comma to achieve this. You can try to run the following code to select and elements,ExampleLive Demo                    div, p {             color: blue;             background-color: orange;          }                     Demo Website       Fruits       Fruits are good for health.                This is demo text.          

Arrow to the left of the tooltip with CSS

George John
Updated on 24-Jun-2020 07:03:37

858 Views

Use the right CSS property to add arrow to the right of the tooltip.You can try to run the following code to add a tooltip with arrow to the leftExampleLive Demo           .mytooltip .mytext {          visibility: hidden;          width: 140px;          background-color: blue;          color: #fff;          z-index: 1;          top: -5px;          left: 110%;          text-align: center;          border-radius: 6px;          padding: 5px 0;          position: absolute;       }       .mytooltip {          position: relative;          display: inline-block;          margin-left: 50px;       }       .mytooltip .mytext:after {          content: "";          position: absolute;          top: 50%;          right: 100%;          margin-top: -5px;          border-width: 6px;          border-style: solid;          border-color: transparent blue transparent transparent;       }       .mytooltip:hover .mytext {          visibility: visible;       }               Keep mouse cursor over me           My Tooltip text          

Selects all elements with alt attribute with CSS

Nancy Den
Updated on 24-Jun-2020 07:02:59

931 Views

To select elements with an attribute, use the CSS [attribute] selector.For example, alt attribute or a target attribute, etc.You can try to run the following code to implement the CSS[attribute] selector,ExampleLive Demo                    img[alt] {             border: 3px solid orange;          }                              

Create rounded image with CSS

Yaswanth Varma
Updated on 08-Jan-2024 14:29:42

2K+ Views

Using CSS, we can build a visually attractive HTML document. Sometimes, when creating a web page, we want certain images or elements to have rounded corners. The CSS border-radius property is used in this situation. It can be used to draw attention to your website and make it stand out to visitors. CSS border-radius property An element's outer border edges can be rounded at the corners using the CSS border-radius property. There can be one, two, three, or four values in this property. The border-radius can be set using the border-radius property. When border-collapse is collapsing, this property does not ... Read More

How to select elements with an attribute value containing a specified word with CSS?

Daniol Thomas
Updated on 24-Jun-2020 07:01:35

180 Views

Use the [attribute ~= "value"] selector to select elements with an attribute value containing a specified word with CSS.You can try to run the following code to implement the [attribute ~= "value"] selector. Here, the word we are searching is “Tutorials”,ExampleLive Demo                    [alt ~= Tutorials] {             border: 5px solid orange;             border-radius: 5px;          }                              

CSS animation-direction property

Krantik Chavan
Updated on 24-Jun-2020 07:00:10

114 Views

Use the animation-direction property to set whether an animation should be played forwards, backward or in alternate cycles.You can try to run the following code to implement the animation-direction property: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 top tooltip with CSS

Nishtha Thakur
Updated on 24-Jun-2020 06:59:27

195 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:ExampleLive Demo           .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          

Advertisements