CSS Articles

Page 107 of 130

Role of CSS :enabled Selector

seetha
seetha
Updated on 15-Mar-2026 258 Views

The CSS :enabled selector is a pseudo-class used to style form elements that are enabled and can be interacted with by users. This selector targets input fields, buttons, and other form controls that are not disabled. Syntax :enabled { /* CSS properties */ } /* Or target specific elements */ input:enabled { /* CSS properties */ } Example: Styling Enabled Input Fields The following example demonstrates how to style enabled input fields with a blue background while disabled fields remain unaffected − ...

Read More

Transform the element by using 16 values of matrix with CSS3

George John
George John
Updated on 15-Mar-2026 267 Views

The CSS matrix3d() function is used to transform HTML elements in 3D space using a 4x4 transformation matrix with 16 values. This powerful function allows you to perform complex 3D transformations including rotation, scaling, skewing, and translation all in one declaration. Syntax transform: matrix3d(a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4); Parameters ValuesDescription a1, b1, c1, d1First row of the 4x4 matrix − controls X-axis scaling and rotation a2, b2, c2, d2Second row of the 4x4 matrix − controls Y-axis scaling and rotation a3, b3, ...

Read More

Role of CSS :empty Selector

usharani
usharani
Updated on 15-Mar-2026 241 Views

The CSS :empty selector targets elements that contain no children. An element is considered empty if it has no child elements, no text content, and no whitespace. This pseudo-class is useful for styling placeholder elements or removing unwanted margins from empty containers. Syntax selector:empty { /* CSS properties */ } What Counts as Empty An element is considered empty if it contains: No child elements No text content No whitespace (spaces, tabs, line breaks) Example: Styling Empty Paragraphs The following example demonstrates how to apply different ...

Read More

Role of CSS: disabled Selector

Chandu yadav
Chandu yadav
Updated on 15-Mar-2026 267 Views

The CSS :disabled selector is used to style form elements that have the disabled attribute. This pseudo-class selector targets input fields, buttons, and other form controls that are disabled and cannot be interacted with by users. Syntax :disabled { /* CSS properties */ } element:disabled { /* CSS properties */ } Example The following example demonstrates how to style enabled and disabled input fields with different background colors − ...

Read More

CSS position: fixed;

George John
George John
Updated on 15-Mar-2026 486 Views

The CSS position: fixed; property positions an element relative to the viewport, which means it stays in the same place even when the page is scrolled. Fixed elements are removed from the normal document flow and positioned using the top, right, bottom, and left properties. Syntax selector { position: fixed; top: value; right: value; bottom: value; left: value; } Possible Values PropertyValueDescription positionfixedSets the positioning method to fixed toplength | %Distance from the ...

Read More

Role of CSS :checked Selector

radhakrishna
radhakrishna
Updated on 15-Mar-2026 288 Views

The CSS :checked pseudo-class selector targets and styles input elements of type checkbox or radio button that are currently checked or selected. This selector allows you to apply specific styles to form controls based on their state. Syntax input:checked { /* CSS properties */ } Example 1: Styling Checked Checkboxes The following example demonstrates how to style checked checkboxes with enhanced size and background color − input[type="checkbox"]:checked { width: 25px; ...

Read More

Style the active link with CSS

Ankith Reddy
Ankith Reddy
Updated on 15-Mar-2026 955 Views

To style the active links, use the CSS :active selector. The :active pseudo-class targets an element during the exact moment it is being clicked or activated by the user. Syntax selector:active { property: value; } Example: Basic Active Link Styling The following example changes the background color of a link when it's being clicked − a { color: blue; text-decoration: none; ...

Read More

Usage of CSS :focus pseudo-class

Arjun Thakur
Arjun Thakur
Updated on 15-Mar-2026 93 Views

The CSS :focus pseudo-class is used to apply styles to form elements when they receive focus (when a user clicks on them or navigates to them using the keyboard). This is particularly useful for improving user experience and accessibility. Syntax selector:focus { property: value; } Example The following example demonstrates how to use the :focus pseudo-class to highlight input fields with an orange background when they are focused − input:focus { ...

Read More

What is a CSS Selector?

mkotla
mkotla
Updated on 15-Mar-2026 615 Views

CSS selectors are patterns used to select and style HTML elements. They act as a bridge between your HTML structure and CSS styles, allowing you to target specific elements or groups of elements on your webpage. Syntax selector { property: value; } Types of CSS Selectors Selector Type Syntax Description Element Selector p Selects all elements of a specific type Class Selector .demo Selects all elements with class="demo" ID Selector #myid Selects the element with id="myid" Universal Selector * Selects ...

Read More

CSS Descendant Selector

varun
varun
Updated on 15-Mar-2026 395 Views

The descendant selector in CSS is used to match all elements that are descendants of a specified element. It allows you to apply styles to nested elements without affecting elements outside the parent container. Syntax ancestor descendant { property: value; } The descendant selector uses a space between the ancestor and descendant elements. It selects all descendant elements, regardless of how deeply nested they are within the ancestor. Example You can try to run the following code to implement CSS Descendant Selector − ...

Read More
Showing 1061–1070 of 1,299 articles
« Prev 1 105 106 107 108 109 130 Next »
Advertisements