Found 1566 Articles for CSS

Role of CSS :last-child Selector

George John
Updated on 22-Jun-2020 15:32:37

151 Views

Use the CSS :last-child selector to style every elements that is the last child of its parent. You can try to run the following code to implement the :last-child selectorLive Demo                    p:last-child {             background: orange;          }                     This is demo text1.       This is demo text2.       This is demo text3.    

Role of CSS :last-of-type Selector

vanithasree
Updated on 30-Jun-2020 11:10:40

85 Views

Use the CSS :last-child selector to style every element that is the last child of its parent.ExampleYou can try to run the following code to implement the :last-child selector −Live Demo                    p:last-of-type {             background: orange;          }                     Heading       This is demo text1.       This is demo text2.       This is demo text3.    

Role of CSS:lang Selector

Chandu yadav
Updated on 30-Jun-2020 11:08:57

65 Views

Use the CSS :lang selector to style every element with a lang attribute value with CSS. You can try to run the following code to implement the :lang selectorExampleLive Demo                    p:lang(fr) {             background: greeb;          }                     This is my country       C'est mon pays       French is the language of France    

Style every element with a lang attribute value with CSS

Sreemaha
Updated on 30-Jun-2020 11:07:51

82 Views

Use the CSS :lang selector to style every element with a lang attribute value. You can try to run the following code to implement the :lang selector:ExampleLive Demo                    p:lang(fr) {             background: green;          }                     This is my country       C'est mon pays       French is the language of France    

Style all elements with an invalid value with CSS

radhakrishna
Updated on 30-Jun-2020 11:13:45

131 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 −Live Demo                    input:invalid {             background: red;          }                     Heading             The style (red color background) appears if you type an irrelevant/ invalid email address.    

Role of CSS :invalid Selector

Arjun Thakur
Updated on 30-Jun-2020 11:12:44

142 Views

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

Role of CSS :in-range Selector

mkotla
Updated on 30-Jun-2020 11:12:18

87 Views

Use the CSS :in-range selector to style elements with a value within a specified range. You can try to run the following code to implement the :in-range selector −ExampleLive Demo                    input:in-range {             border: 3px dashed orange;             background: yellow;          }                           The style only works for the value entered i.e. 9    

Style links on mouse over with CSS

Ankith Reddy
Updated on 30-Jun-2020 11:11:46

204 Views

To style links on mouse over with CSS, use the CSS: hover selector. You can try to run the following code to implement the: hover, selector,ExampleLive Demo                    a:hover {             background-color: orange;          }                     Google       Keep the mouse cursor on the above link and see the effect.    

Role of CSS :first-of-type Selector

George John
Updated on 30-Jun-2020 09:48:52

96 Views

Use the CSS :first-of-type selector to style every element that is the first element of its parent with CSS.ExampleYou can try to run the following code to implement the :first-of-type selectorLive Demo                    p:first-of-type {             background: orange;          }                     This is demo text1.       This is demo text2.    

Role of CSS: first-child Selector

Chandu yadav
Updated on 30-Jun-2020 09:48:28

115 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 selectorLive Demo                    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.          

Advertisements