Use the CSS :link selector to style all unvisited links. You can try to run the following code to implement the :link selector −ExampleLive Demo a:link { background-color: orange; } Demo Websitehttps://www.example.com/
Use the CSS :nth-of-type(n) selector to style every element that is the nth element of its parent. You can try to run the following code to implement the :nth-of-type(n) selectorExampleLive Demo p:nth-of-type(2) { background: yellow; } This is demo text 1. This is demo text 2. This is demo text 3. This is demo text 4.
Use SUBSTRING_INDEX() for this. Let us first create a table −mysql> create table DemoTable -> ( -> UserMailId varchar(100) -> ); Query OK, 0 rows affected (0.68 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('John@gmail.com'); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable values('Carol94844@yahoo.com'); Query OK, 1 row affected (0.25 sec)Display all records from the table using select statement −mysql> select *from DemoTable;OutputThis will produce the following output −+----------------------+ | UserMailId | +----------------------+ | John@gmail.com ... Read More
Use the CSS :nth-of-type(n) selector to style every element that is the nth element of its parent. You can try to run the following code to implement the :nth-of-type(n) selectorExampleLive Demo p:nth-of-type(2) { background: yellow; } This is demo text 1. This is demo text 2. This is demo text 3. This is demo text 4.
Let us first create a table −mysql> create table DemoTable -> ( -> Name varchar(100) -> ); Query OK, 0 rows affected (2.23 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('John'); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable values('Sam\''s'); Query OK, 1 row affected (0.28 sec) mysql> insert into DemoTable values('David\''s'); Query OK, 1 row affected (0.36 sec)Display all records from the table using select statement −mysql> select *from DemoTable;OutputThis will produce the following output −+----------+ | Name | +----------+ | John ... Read More
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.
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.
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
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.
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.