Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
CSS Articles
Page 21 of 130
Role of CSS :only-of-type Selector
Use the CSS :only-of-type selector to style every element that is the only element of its parent.ExampleYou can try to run the following code to implement the :only-of-type selector p:only-of-type { background: orange; color: white; } This is demo text 1. This is demo text 2. This is demo text 3. This is demo text 4.
Read MoreRole of CSS :only-child Selector
Use the CSS :only-child selector to style every element that is the only child of its parent.ExampleYou can try to run the following code to implement the :only-child selector p:only-child { background: orange; } Heading This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph.
Read MoreRole of CSS :optional Selector
Use the CSS :optional selector to style elements with no "required" attributeExampleYou can try to run the following code to implement the :optional selector: input:optional { background-color: blue; } Subject: Student:
Read MoreStyle <input> elements with a value outside a specified range with CSS
Use the CSS :out-of-range selector to style elements with a value outside a specified range.ExampleYou can try to run the following code to implement the :out-of-range selector: input:out-of-range { border: 3px dashed orange; background: yellow; } The style only works for the value entered out of range
Read MoreRole of CSS : read-only Selector
Use the CSS :read-only selector to select elements that are read-only.ExampleYou can try to run the following code to implement the :read-only selector: input:read-only { background-color: blue; color: white; } Subject: Student:
Read MoreStyle <input> elements with a "readonly" attribute with CSS
To select elements that are read-only, use the CSS :read-only selector.ExampleYou can try to run the following code to implement the :read-only selector input:read-only { background-color: blue; color: white; } Subject: Student:
Read MoreRole of CSS :read-write Selector
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: input:read-write { background-color: blue; color: white; } Subject: Student:
Read MoreRole of CSS :required Selector
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:Example input:required { background-color: orange; } Subject: Student:
Read MoreRole of CSS :target Selector
Use the CSS :target selector to highlight active HTML anchor with CSS.ExampleYou can try to run the following code to implement the :target Selector :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
Read MoreRole of CSS :visited Selector
Use the CSS : visited selector to style all visited links.ExampleYou can try to run the following code to implement the :visited selector: a:link, a:visited { background-color: white; color: black; border: 1px solid blue; padding: 30px 30px; text-align: center; text-decoration: none; display: inline-block; } a:hover, a:active { background-color: red; color: white; } Demo Link
Read More