The border-width Property in CSS

AmitDiwan
Updated on 28-Dec-2023 18:18:25

104 Views

The CSS border-width property is used to specify the width for border of an element. We can also set width for individual sides using the following properties − border-top-width border-right-width border-left-width border-right-width Syntax The syntax of the CSS border-width property is as follows − Selector { border-width: /*value*/ } The value can be thin, thick, or medium. Set a thick border The following example illustrate CSS border-width property. The thick border is set using the border-width property − border-width: thick; Example Let us see the example − ... Read More

The border-style Property in CSS

AmitDiwan
Updated on 28-Dec-2023 18:17:18

113 Views

The CSS border-style property is used to specify the border style for an element. We can also define border-style for individual sides using the − border-top-style border-right-style, border-left-style border-bottom-style Syntax The syntax of CSS border property is as follows − Selector { border-style: /*value*/ } The value can be any of the following − dotted − Set a dotted border dashed − Set a dashed border solid − Set a solid border double − Set a double border groove − Set a 3D grooved border ridge − Set a 3D ... Read More

The border-color Property in CSS

AmitDiwan
Updated on 28-Dec-2023 18:16:24

124 Views

The CSS border-color property is used to specify a border color for elements. We can also set color for individual sides using the − border-top-color border-right-color border-left-color border-right-color Syntax The syntax of CSS border-color property is as follows − Selector { border-color: /*value*/ } Above, the value can be any color. The following examples illustrate CSS border-color property − Set border color The border color for the border is set using the border-color property. Let us see the example − ... Read More

The border Shorthand Property in CSS

AmitDiwan
Updated on 28-Dec-2023 18:14:37

230 Views

The border property is used to define the border properties for an element. It is a shorthand for the following properties − border-width − medium, thin, thick or a specific length border-style − solid, dashed, dotted, double border-color − Set the color Syntax The syntax of the CSS border property is as follows − Selector { border: /*value*/ } The value is the border style, width, and color. The following examples illustrate CSS border property − Set a dotted border In this example, we have set a dotted border using the border ... Read More

The Background Shorthand Property in CSS

AmitDiwan
Updated on 28-Dec-2023 18:13:29

458 Views

The CSS background shorthand property is used to define a background for an element. background-color, background-image, background-repeat, background-position, background-clip, background-size, background-origin and background-attachment together comprise the CSS background properties. Syntax The syntax of the CSS background property is as follows − Selector { background: /*value*/ } The value can be − background-color − Set the background color background-image − Set the background images background-position − Set the position of the background images background-size − Set the size of the background images background-repeat − Set how to repeat the background images background-origin − Set the ... Read More

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

The :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

Advertisements