Role of CSS Empty Selector

usharani
Updated on 30-Jun-2020 09:49:59

228 Views

Use the CSS :empty selector to style every element that has no children with CSS. You can try to run the following code to implement the :empty selector −ExampleLive Demo                    p.demo {             width: 300px;             height: 20px;             background: gray;           }           p:empty {              width: 150px;              height: 20px;              background: orange;          }                     This is demo text. Below is empty text.          

Select Month and Year from Dates in MySQL

Sharon Christine
Updated on 30-Jun-2020 09:49:03

468 Views

To select month and year in MySQL, you can use MONTH() and YEAR() method. Let us first create a table −mysql> create table DemoTable    -> (    -> DueDate datetime    -> ); Query OK, 0 rows affected (0.90 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2019-01-21'); Query OK, 1 row affected (0.22 sec) mysql> insert into DemoTable values('2019-06-15'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable values('2018-12-01'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable values('2015-04-01'); Query OK, 1 row affected (0.16 sec) ... Read More

Role of CSS :first-of-type Selector

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

178 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

213 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.          

CSS Position Absolute

Prabhas
Updated on 30-Jun-2020 09:47:24

265 Views

The position: absolute; property allows you to position element relative to the nearest positioned ancestor.ExampleYou can try to run the following code to implement CSS position: absolute;Live Demo                    div.one {             position: relative;             width: 500px;            height: 150px;            border: 2px solid blue;          }          div.two {             position: absolute;             top: 70px;             right: 0;             width: 300px;             height: 50px;             border: 2px solid yellow;          }                     position: absolute;       The position: absolute; property allows you to position element relative to the nearest positioned ancestor.       div has position: relative;          div has position: absolute;          

Set a Certain Value First with MySQL ORDER BY

Sharon Christine
Updated on 30-Jun-2020 09:47:00

1K+ Views

Let us first create a table −mysql> create table DemoTable    -> (    -> Number int    -> ); Query OK, 0 rows affected (0.57 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values(20); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values(12); Query OK, 1 row affected (0.22 sec) mysql> insert into DemoTable values(14); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values(19); Query OK, 1 row affected (0.14 sec) ... Read More

Style Every Enabled Input Element with CSS

Arjun Thakur
Updated on 30-Jun-2020 09:46:17

215 Views

To style every enabled element, use the CSS :enabled selector.ExampleYou can try to run the following code to style enabled elementLive Demo                    input:enabled {             background: blue;          }                              Subject          Student:          Age:          

What is a CSS Selector

mkotla
Updated on 30-Jun-2020 09:45:26

597 Views

The selectors in CSS are patterns to select the element to style.Let us see the key selectors in CSS −SelectorDemoDescription class.demoSelects all elements with class="demo"#id#myidSelects the element with id="myid"**Used to select all the elements

Counting Non-Null or Non-Zero Columns in a MySQL Table

karthikeya Boyini
Updated on 30-Jun-2020 09:45:00

649 Views

Use if() method for this. Let us first create a table −mysql> create table DemoTable    -> (    -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> Number1 int,    -> Number2 int    -> ); Query OK, 0 rows affected (1.15 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(Number1, Number2) values(10, 20); Query OK, 1 row affected (0.41 sec) mysql> insert into DemoTable(Number1, Number2) values(0, 32); Query OK, 1 row affected (0.38 sec) mysql> insert into DemoTable(Number1, Number2) values(40, 0); Query OK, 1 row affected (0.21 sec) mysql> insert ... Read More

Role of CSS Active Selector

usharani
Updated on 30-Jun-2020 09:44:49

295 Views

Use the CSS :active selector to style the active links. You can try to run the following code to implement the :active selector −ExampleLive Demo                    a:active {             background-color: orange;          }                     Welcome to Qries       Click on the above link to see the effect.    

Advertisements