Get the latest tech news

The attr() function in CSS now supports types


The attr() function in CSS is a powerful function that allows you to use the value of an attribute of an HTML element as the value of a CSS property. This function is commonly used with the content property in pseudo-elements to display the value of an attribute on the page.

This function is commonly used with the content property in pseudo-elements to display the value of an attribute on the page. Notice, in this example, we are using only one common class box to customize the width of the div elements based on the value of the data-width attribute. If you enjoy my work ( the articles, the open-source projects, my general demeanour... anything really), consider leaving a tip& supporting the site.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Function

Function

Photo of types

types

Photo of css

css

Related news:

News photo

Creating 3D Worlds with HTML and CSS (2013)

News photo

I finally found a lightweight multitool that doesn't sacrifice function for form - and it's only $30

News photo

We keep reinventing CSS, but styling was never the problem