AmitDiwan has Published 10744 Articles

The :first-child Pseudo-class in CSS

AmitDiwan

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 ... Read More

The ::first-line Pseudo-element in CSS

AmitDiwan

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 ... Read More

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

AmitDiwan

AmitDiwan

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

472 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 ... Read More

text-justify Property in CSS

AmitDiwan

AmitDiwan

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

650 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 ... Read More

Text in Transparent Box using CSS3

AmitDiwan

AmitDiwan

Updated on 27-Dec-2023 16:49:02

2K+ Views

The opacity property is used to create a transparent textbox. Set an image in the transparent box using the background property. Since, we have set the opacity, it will make the text and image appearing in the text box to be transparent. Create a div container A div container is ... Read More

Styling Forms with CSS Attribute Selectors

AmitDiwan

AmitDiwan

Updated on 27-Dec-2023 16:47:26

422 Views

Apply styles to HTML elements with particular attributes using Attribute Selectors in CSS. Let us see which attribute selectors are available with the rules. The [attribute] Selector The [attribute] selector selects elements with a specified attribute. Here, the link with the attribute target is styled − a[target] { ... Read More

Styling First-Letters with CSS ::first-letter

AmitDiwan

AmitDiwan

Updated on 27-Dec-2023 16:45:42

1K+ Views

CSS can help us style the first letter of an element using the ::first-letter pseudo-element. Note that punctuation marks, digraphs and content property can change the first-letter. The following examples illustrate CSS ::first-letter pseudo-element. Style the first letter The first letter of all the elements, such as and ... Read More

Styling different states of a link using CSS

AmitDiwan

AmitDiwan

Updated on 27-Dec-2023 16:39:43

244 Views

Using CSS pseudo selectors, namely, :active, :hover, :link and :visited, we can style different states of a link. For proper functionality, the order of these selectors is given by:- :link, :visited, :hover, :active. Syntax The syntax of CSS text-indent property is as follows − a:(pseudo-selector) { ... Read More

Standard Link Styles in CSS

AmitDiwan

AmitDiwan

Updated on 27-Dec-2023 16:38:33

421 Views

We can style links as per our requirements. It is recommended that links have styles which distinguish them from normal text. The default link styles for different link states is as follows − Link State Color active #EE0000 focus #5E9ED6 or a similar shade ... Read More

Stacking Elements in Layers using z-index Property using CSS

AmitDiwan

AmitDiwan

Updated on 27-Dec-2023 16:36:33

314 Views

Using CSS Z-Index property developer can stack elements onto one another. Z-Index can have a positive or a negative value. NOTE − If elements that overlap do not have z-index specified then that element will show up that is mentioned last in document. The following are some examples to implement ... Read More

Advertisements