CSS Articles

Page 20 of 130

CSS position: fixed;

George John
George John
Updated on 11-Mar-2026 481 Views

The position: fixed; property allows you to position element relative to the viewport. You can try to run the following code to implement CSS position: fixed;Example                    div{             position: fixed;             bottom: 0;             right: 0;             width: 200px;             border: 3px solid blue;          }                     position: fixed;       The position: fixed; property allows you to position element relative to the viewport.                div has position: fixed;           Output

Read More

Role of CSS: disabled Selector

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 262 Views

Use the CSS :disabled selector to style every disabled element. You can try to run the following code to implement the :disabled selectorExample                    input:enabled {             background: blue;          }          input:disabled {             background: red;          }                              Subject          Student:          Age:          

Read More

Role of CSS :empty Selector

usharani
usharani
Updated on 11-Mar-2026 236 Views

Use the CSS :empty selector to style every element that has no children with CSS. You can try to run the following code to implement the :empty selector −Example                    p.demo {             width: 300px;             height: 20px;             background: gray;           }           p:empty {              width: 150px;              height: 20px;              background: orange;          }                     This is demo text. Below is empty text.          

Read More

Role of CSS :enabled Selector

seetha
seetha
Updated on 11-Mar-2026 251 Views

Use the CSS :enabled selector to style every enabled element. You can try to run the following code to implement the :enabled selector −Example                    input:enabled {             background: blue;          }                              Subject          Student:          Age:          

Read More

Role of CSS: first-child Selector

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 223 Views

Use the CSS :first-child selector to style every elements that is the first child of its parent.ExampleYou can try to run the following code to implement the :first-child selector                    p:first-child {             background-color: orange;          }                     Heading       This is demo text.                This is demo text, with the first child of its parent div.          This is demo text, but not the first child.          

Read More

Style all <input> elements with an invalid value with CSS

radhakrishna
radhakrishna
Updated on 11-Mar-2026 229 Views

To style all elements with an invalid value, use the CSS :invalid selector.ExampleYou can try to run the following code to implement the :invalid selector −                    input:invalid {             background: red;          }                     Heading             The style (red color background) appears if you type an irrelevant/ invalid email address.    

Read More

Role of CSS :link Selector

Giri Raju
Giri Raju
Updated on 11-Mar-2026 260 Views

Use the CSS :link selector to style all unvisited links. You can try to run the following code to implement the :link selector −Example                    a:link {             background-color: orange;          }                     Demo Websitehttps://www.example.com/    

Read More

Role of CSS :not (selector) Selector

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 402 Views

Use the CSS :not(selector) selector to style every element that is not the specified element. You can try to run the following code to implement the :not selectorExample                    p {             color: red;          }          :not(p) {             color: blue;          }                     Heading 1       Heading 2       Heading 3       This is a paragraph.       This is another paragraph.    

Read More

Role of CSS :nth-child(n) Selector

George John
George John
Updated on 11-Mar-2026 274 Views

Use the CSS :nth-child(n) selector to style every element that is the second child of its parent with CSS. You can try to run the following code to implement the :nth-child(n) selectorExample                    p:nth-child(4) {             background: orange;             color: white;          }                     This is demo text 1.       This is demo text 2.       This is demo text 3.       This is demo text 4.       This is demo text 5.       This is demo text 6.    

Read More

X-axis 3D transform with CSS3

Ankith Reddy
Ankith Reddy
Updated on 11-Mar-2026 115 Views

You can try to run the following code to implement X-axis 3D transform with CSS3Example                    div {             width: 200px;             height: 100px;             background-color: pink;             border: 1px solid black;          }            div#myDiv {             -webkit-transform: rotateX(150deg);             /* Safari */ transform: rotateX(150deg);             /* Standard syntax */          }                              tutorials point.com                      Rotate X-axis                             tutorials point.com.                

Read More
Showing 191–200 of 1,299 articles
« Prev 1 18 19 20 21 22 130 Next »
Advertisements