The nth-child Pseudo Class in CSS

AmitDiwan
Updated on 28-Dec-2023 15:25:53

179 Views

The CSS :nth-child() pseudo-class selects an element that is the nth child element of some other element. It matches elements that are the nth child of its parent. Syntax The following is the syntax for the :nth-child pseudo class − :nth-child(){ /*declarations*/ } Select the nth child in a form Let’s see an example for the CSS :nth-child() Pseudo class. First, set a form using the − CSS :nth-child() Pseudo Class ... Read More

Last Child Pseudo Class in CSS

AmitDiwan
Updated on 28-Dec-2023 15:24:39

201 Views

The CSS :last-child pseudo-class selects an element that is the last child element of some other element. As the name suggests, it will select the last child of its parent. Let us see some examples to implement the :last-child pseudo class. Syntax The following is the syntax for the :last-child class − :last-child{ /*declarations*/ } Style a table with the :last-child pseudo class Let’s see an example of the CSS last-child Pseudo class. In this example, we have set a table − Demo ... Read More

The :lang Pseudo-Class in CSS

AmitDiwan
Updated on 28-Dec-2023 15:23:08

125 Views

The CSS :lang() pseudo-class selector is used to select the elements with lang attribute specified. This helps us target a specific language associated with the content and style them accordingly. We can set multiple languages using this selector. A two-letter language code is to be set i.e., the following for Italian − Bella ciao The following for English − Nice hello The following for Spanish − Bueno adios Syntax The following is the syntax to implement the :lang pseudo class − :lang(){ /*declarations*/ } Set the lang attribute The ... Read More

The :first-child Pseudo-Class in CSS

AmitDiwan
Updated on 28-Dec-2023 15:21:20

76 Views

The CSS :first-child pseudo-class selects an element that is the first child element of some other element. Syntax The following is the syntax of the :first-child pseudo class − :first-child{ /*declarations*/ } Example Let’s see an example of CSS first-child Pseudo class. We have set no left border for the first element of the and − td:first-child, th:first-child { border-left: none; } Here is the example − table { ... Read More

The First Line Pseudo-Element in CSS

AmitDiwan
Updated on 28-Dec-2023 15:20:14

106 Views

The first-line Pseudo Element selects the first line of the content of an element or a container. It is denoted by double colon i.e. − ::first-line Let’s see some examples of CSS ::first-line pseudo element − Style the first line In this example, we will style the first line using the pseudo element − p::first-line { background-color: lightgreen; color: white; } Example Let us see the example − ... Read More

The ::before and ::after Pseudo-Element in CSS

AmitDiwan
Updated on 28-Dec-2023 15:16:35

506 Views

The CSS ::before and CSS ::after Pseudo-element are used to insert some content before and after the element respectively. The ::after pseudo element If you want to insert a content after an element, then use the ::after pseudo-element. The content to be placed after is set using the content attribute − p::after { content: " is Virat Kohli"; background-color: red; font-weight: bold; } Example Let us see the example − p { ... Read More

Text Justify Property in CSS

AmitDiwan
Updated on 28-Dec-2023 14:48:57

715 Views

The text-justify property in CSS is used to set the justification method of text when the text-align property is set to the justify value. Let us see the syntax − text-justify: value; The value here can be any of the following − auto− Sets automatically and the web browser determines inter-word− To increase or decrease the space between words inter-character− To increase or decrease the space between characters none− The justification method is disabled The syntax can also be seen like this − text-justify: auto|inter-word|inter-character|none|initial|inherit; Inter-word justification of text In this example, we have ... Read More

Commonly Used Methods in LocalDate, LocalTime, and LocalDateTime Classes in Java

Rudradev Das
Updated on 27-Dec-2023 17:57:41

203 Views

There are three types of most important classes we can find in a Java environment, related to date and time. LocalDate, LocalTime and LocalDateTime are available in the Java programming to handle the operations related with the date and time problems. Here we need to import the Java package as java.time which is a main application programming interface aka API for date, time, instants, and the time durations. Purpose of the LocalDate, LocalTime and LocalDateTime classes are − java.time.* //It is the process to include all classes java.time.LocalDate //It is the process for LocalDate java.time.LocalDateTime //It is the process ... Read More

Collectors toSet Method in Java 8

Rudradev Das
Updated on 27-Dec-2023 17:51:27

2K+ Views

Collections reverse order class is a reverse order method, which is encoded in the collections class. It is present in the java.util package. It returns a comparator as a result, which is a predefined comparator in nature. By using this comparator package, we can rearrange the collections of a particular data set in a reverse manner. The Collectors toSet() is a collector class, which itself returns a collector and accumulates those particular elements as an input into a new set. toSet() is an unordered collector class which is not accountable to preserve the order of the encounter of some input ... Read More

Collections Sort in Java with Examples

Rudradev Das
Updated on 27-Dec-2023 17:45:36

1K+ Views

The collection class is an enhanced static method to sort the elements from a particular collection of a list or an array. For this process, we can use a tree set also, when we operate on a set of elements as present as the raw set type primarily. The Collections.sort() method is present in the java.util.Collections class, and enables the user to sort the elements from a specific list in an ascending order. The method is an upgraded version of the java.util.Arrays.sort() method class, which is capable to sort the elements from a linked list as well as queue and ... Read More

Advertisements