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
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.
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.
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;
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
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:
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
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
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.
To style every disabled element, use the CSS :disabled selector. You can try to run the following code to style disabled element −ExampleLive Demo input:enabled { background: blue; } input:disabled { background: red; } Subject Student: Age: