logo

CSS

Web Development Updates

CSS backdrop-filter is Finally Unprefixed Across All Browsers

With the release of Safari 18 beta, backdrop-filter CSS property is finally un-prefixed across all browsers.
13 June 2024
CSS

Changing Color of Radio Buttons with CSS accent-color

The color of radio buttons can be changed using the CSS accent-color property.
13 November 2021
CSS

Apply Background Color on Text Spanning Multiple Lines

To apply the background color only on the text spanning to multiple lines, the solution is to make the text container as an inline element rather than a block element.
22 March 2021
CSS

Play, Pause & Restart CSS Animations

Playing & pausing a CSS animation can be done by using the animation-play-state property. Completely restarting the animation can be done by first removing the animation and then applying it again.
12 March 2021
CSS

CSS Animation on Element Dynamically Inserted to DOM

Animation can be done on an element which is dynamically inserted to page using CSS animation property. This property allows to give an initial and the final state of an element, and perform an animation between those states.
10 March 2021
CSS

Text with Linear Gradient Background

A linear gradient background can be applied for a text by using the background-clip: text CSS property. With this the linear gradient background will be clipped to the text only.
8 March 2021
CSS

Responsive Youtube / Vimeo Embeds with CSS

Using some CSS, Youtube / Vimeo iframes can be laid out in a specified aspect ratio. Once aspect ratio of the iframe is set, videos will be responsive.
28 February 2021
CSS

Set Image as Background for Text with CSS

An image can be set as the background for a text by using the background-clip: text CSS property. This property will make the background extend beneath the text only.
21 February 2021
CSS

CSS Styling for Custom Elements

Custom elements can be styled using CSS defined in its Shadow DOM, or through user-defined CSS defined in the main page. User-defined CSS rules will always override the CSS defined in the Shadow DOM.
19 February 2021
Javascript

Using External CSS Stylesheets for Custom Elements

While creating a custom element, it is perfectly fine to use an external stylesheet for defining the element's CSS.
16 February 2021
CSS

Creating Pie Charts with CSS

Pie charts can be created using the CSS conic-gradient() function. This creates an image gradient which can then be placed as the background of the container.
15 February 2021
CSS

Create DIV of a Given Aspect Ratio with CSS

The CSS aspect-ratio property makes it very easy to create containers of a given aspect ratio.
8 February 2021
CSS

Hiding a Custom Element Until It Gets Defined

The :defined and :not CSS pseudo-classes can be used to hide the custom element until the defining Javascript gets loaded.
5 February 2021
CSS

CSS Styling of File Upload Button with ::file-selector-button Selector

The upload button in file input type is represented by ::file-selector-button CSS pseudo-element. This can be used to style the file input type.
24 January 2021
CSS

Custom Checkbox with CSS appearance Property

Checkboxes can be customized using the CSS appearance property. This property allows to suppress the native appearance of an element so that CSS can be used to restyle it.
23 January 2021
CSS

Custom Radio Buttons with CSS appearance Property

The look of radio buttons can be customized using the CSS appearance property. This property allows to suppress the native appearance of an element so that CSS can be used to restyle it.
18 January 2021
CSS

Hide Dropdown Arrow for Select Input with CSS appearance

The arrow icon in select input can be hidden by setting the CSS appearance to none. This property allows to suppress the native appearance of an element, so that CSS can be used to restyle it.
15 January 2021
CSS

Setting a Fixed Width for Items in CSS Flexbox

A flexbox item can be set to a fixed width by setting 3 CSS properties - flex-basis, flex-grow & flex-shrink.
27 December 2020
CSS

How to Animate Bullets in Lists

Bullets in a HTML list can be animated using the ::marker CSS selector. This selector selects the marker box (bullet / number) for list items.
26 December 2020
CSS

Change Bullet Color for Lists with ::marker CSS Selector

Bullet color for HTML lists can be changed using the ::marker CSS selector. This selector selects the marker box (bullet or number) for list items.
26 December 2020