Found 1566 Articles for CSS

Role of CSS: valid Selector

Chandu yadav
Updated on 01-Jul-2020 09:20:32

143 Views

Use the CSS : valid selector to style all elements with a valid value .ExampleYou can try to run the following code to implement the :valid SelectorLive Demo                    input:valid {             background: red;             color: white;          }                     Heading             The style (red color background) appears if you type a relevant/ valid email address.    

Style to highlight active HTML anchor with CSS

Prabhas
Updated on 01-Jul-2020 09:20:09

2K+ Views

To highlight active HTML anchor with CSS, use the :target selector.ExampleYou can try to run the following code to implement the :target Selector:Live Demo                    :target {             border: 2px solid #D4D4D4;             background-color: orange;             color: white;          }                     Click any of the subject below.       Maths       Java       C++       C       This is demo text.       This is demo text.       This is demo text.       This is demo text.       This is demo text.       Maths Tutorial       Java Tutorial       C++ Tutorial       C Tutorial    

Style every element that is not the specified element with CSS

varma
Updated on 01-Jul-2020 09:19:46

77 Views

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

Role of CSS :target Selector

Arjun Thakur
Updated on 01-Jul-2020 09:19:09

173 Views

Use the CSS :target selector to highlight active HTML anchor with CSS.ExampleYou can try to run the following code to implement the :target SelectorLive Demo                    :target {             border: 2px solid #D4D4D4;             background-color: orange;             color: white;          }                     Click any of the subject below.       Maths       Java       C++       C       This is demo text.       This is demo text.       This is demo text.       This is demo text.       This is demo text.       Maths Tutorial       Java Tutorial       C++ Tutorial       C Tutorial    

Style the document's root element with CSS

Ankith Reddy
Updated on 01-Jul-2020 09:18:45

105 Views

To style document’s root element, use the CSS: root selector.ExampleYou can try to run the following code to implement the: root SelectorLive Demo                    :root {             background: blue;             color: white;          }                     Heading       This is demo text.    

Style elements with a "required" attribute with CSS

Chandu yadav
Updated on 01-Jul-2020 09:17:28

362 Views

Use the CSS : required selector to style elements with a "required" attribute.ExampleYou can try to run the following code to implement the :required SelectorLive Demo                    input:required {             background-color: orange;          }                              Subject:          Student:          

CSS position: sticky;

Arjun Thakur
Updated on 01-Jul-2020 09:17:53

419 Views

The position: sticky; property allows you to position an element based on scroll position. Set an element as sticky on the top when a user scrolls down.ExampleYou can try to run the following code to implement CSS position: sticky;Live Demo                    div.sticky {             position: -webkit-sticky;             position: sticky;             top: 0;             padding: 10px;             background-color: orange;             border: 1px solid blue;          }                     Scroll and see the effect!       Sticky!                This is demo text.          Scroll down to view the sticky div.          

Role of CSS :required Selector

Sreemaha
Updated on 01-Jul-2020 09:17:05

133 Views

Use the CSS :required selector to style <input> elements with a "required" attribute. You can try to run the following code to implement the :required selector:ExampleLive Demo                    input:required {             background-color: orange;          }                              Subject:          Student:          

Style element with no "readonly" attribute with CSS

Ankith Reddy
Updated on 01-Jul-2020 09:16:36

317 Views

Use the CSS: read-write selector to select elements with no "readonly" attribute.ExampleYou can try to run the following code to implement the: read-write selectorLive Demo                    input:read-write {             background-color: blue;             color: white;          }                              Subject:          Student:          

Role of CSS :read-write Selector

usharani
Updated on 01-Jul-2020 09:15:49

52 Views

Use the CSS :read-write selector to select elements that are ‘readable’ and ‘writable’.ExampleYou can try to run the following code to implement the :read-write selector:Live Demo                    input:read-write {             background-color: blue;             color: white;          }                              Subject:          Student:          

Advertisements