Style Second Child p Element with CSS

Arjun Thakur
Updated on 30-Jun-2020 11:22:25

1K+ Views

To style every element that is the second child of its parent with CSS, use the CSS :nth-child(n) selector.ExampleYou can try to run the following code to implement the :nth-child(n) selectorLive Demo                    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.    

Update Only Day Portion of MySQL Date

Sharon Christine
Updated on 30-Jun-2020 11:21:41

1K+ Views

Let us first create a table −mysql> create table DemoTable -> ( -> AdmissionDate date -> ); Query OK, 0 rows affected (1.38 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2019-05-12'); Query OK, 1 row affected (0.52 sec) mysql> insert into DemoTable values('2019-05-18'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable values('2019-04-19'); Query OK, 1 row affected (0.42 sec)Display all records from the table using select statement −mysql> select *from DemoTable;OutputThis will produce the following output −+---------------+ | AdmissionDate | +---------------+ | 2019-05-12 | | 2019-05-18 ... Read More

Update Column Data Without Using Temporary Tables in MySQL

Sharon Christine
Updated on 30-Jun-2020 11:20:32

328 Views

For this, use CASE statement. This will work even without using temporary tables. Let us first create a table −mysql> create table DemoTable    -> (    -> UserName varchar(100),    -> UserStatus varchar(100)    -> ); Query OK, 0 rows affected (0.74 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('John', 'Active'); Query OK, 1 row affected (0.29 sec) mysql> insert into DemoTable values('Chris', 'Inactive'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable values('Bob', 'Inactive'); Query OK, 1 row affected (0.32 sec) mysql> insert into DemoTable values('Robert', 'Active'); ... Read More

Get Maximum Count of Distinct Values in a Separate Column with MySQL

karthikeya Boyini
Updated on 30-Jun-2020 11:19:22

433 Views

Use COUNT() function along with GROUP BY clause for this. Let us first create a table −mysql> create table DemoTable -> ( -> Name varchar(100) -> ); Query OK, 0 rows affected (0.69 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('John'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable values('Sam'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values('John'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable values('Mike'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable values('John'); Query ... Read More

X-axis 3D Transform with CSS3

Ankith Reddy
Updated on 30-Jun-2020 11:19:17

112 Views

You can try to run the following code to implement X-axis 3D transform with CSS3ExampleLive Demo                    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.                

Truncate Results in Decimal to Integer Value with MySQL

karthikeya Boyini
Updated on 30-Jun-2020 11:18:07

563 Views

Use truncate() for this, for example, 190.245 to 190. Following is the syntax −select truncate(yourColumnName, 0) from yourTableName;Let us first create a table −mysql> create table DemoTable    -> (    -> Value DECIMAL(10, 4)    -> ); Query OK, 0 rows affected (0.67 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(45.567); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable values(100.0000); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable values(15.89000); Query OK, 1 row affected (0.25 sec)Display all records from the table using select statement −mysql> ... Read More

Role of CSS nth-child(n) Selector

George John
Updated on 30-Jun-2020 11:18:06

243 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) selectorExampleLive Demo                    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.    

Role of CSS: Not Selector

Chandu yadav
Updated on 30-Jun-2020 11:17:36

372 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 selectorExampleLive Demo                    p {             color: red;          }          :not(p) {             color: blue;          }                     Heading 1       Heading 2       Heading 3       This is a paragraph.       This is another paragraph.    

Style All Unvisited Links with CSS

radhakrishna
Updated on 30-Jun-2020 11:17:07

706 Views

To style all unvisited links, use the CSS :link selector. 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/    

Selecting Records Within a Range and With Conditions on Two Columns in MySQL

karthikeya Boyini
Updated on 30-Jun-2020 11:16:59

424 Views

For this, use where clause. Let us first create a table −mysql> create table DemoTable -> ( -> Number1 int, -> Number2 int -> ); Query OK, 0 rows affected (3.73 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(40, 50); Query OK, 1 row affected (0.60 sec) mysql> insert into DemoTable values(100, 59); Query OK, 1 row affected (0.56 sec) mysql> insert into DemoTable values(400, 500); Query OK, 1 row affected (0.40 sec)Display all records from the table using select statement −mysql> select *from DemoTable;OutputThis will produce the following output −+---------+---------+ | ... Read More

Advertisements