Search
Crypto Adoption Advocate 1xBit Adds EOS to Its Sportsbook and Casino
8.10.2020
October 8th 2020, Limassol, Cyprus – 1xBit Casino Sportsbook has announced its support for one of the markets hottest cryptocurrencies, EOS. The PoS (delegated-proof-of-stake) token is used on the EOS platform for developers to build Dapps, but also offers the everyday user a rapid, free...
Let’s Make a Multi-Thumb Slider That Calculates The Width Between Thumbs
23.6.2020
HTML has an <input type="range">, which is, you could argue, the simplest type of proportion slider. Wherever the thumb of that slider ends up could represent a proportion of whatever is before and whatever is after it (using the value and max attributes). Getting fancier, it’s possible...
How to Tame Line Height in CSS
15.5.2020
In CSS, line-height is probably one of the most misunderstood, yet commonly-used attributes. As designers and developers, when we think about line-height, we might think about the concept of leading from print design — a term, interestingly enough, that comes from literally putting pieces of lead...
Better Form Inputs for Better Mobile User Experiences
17.4.2020
Here’s one simple, practical way to make apps perform better on mobile devices: always configure HTML input fields with the correct type, inputmode, and autocomplete attributes. While these three attributes are often discussed in isolation, they make the most sense in the context of mobile user...
JavaScript Picture-in-Picture API
14.4.2020
As a huge fan of media on the web, I’m always excited about enhancements to how we can control our media. Maybe I get excited about simple things like the <video> tag and its associated elements and attributes because media on the web started with custom codecs, browser extensions,...
Did You Know the Ordered List Element Has Start and Reversed Attributes?
24.3.2020
I sure didn't! Tomek Sułkowsi shows how we can reverse the numbering of ordered lists with a simple HTML attribute:
<ol reversed<liApple</li<liBanana</li<liPear</li</ol
CodePen Embed Fallback
And the start attribute can be added to begin the list at a number other...
Do This to Improve Image Loading on Your Website
20.2.2020
Jen Simmons explains how to improve image loading by simply using width and height attributes. The issue is that there’s a lot of jank when an image is first loaded because an img will naturally have a height of 0 before the image asset has been successfully downloaded by the browser. Then it needs...
A Complete Guide to Data Attributes
18.2.2020
Everything you ever wanted to know about data attributes in HTML, CSS, and JavaScript.
The post A Complete Guide to Data Attributes appeared first on CSS-Tricks
Listen to your web pages
16.2.2020
A clever idea from Tom Hicks combining MutationObserver (which can "observe" changes to elements like when their attributes, text, or children change) and the Web Audio API for creating sounds. Plop this code into the console on a page where you'd like to listen to essentially any DOM change...
Helping Browsers Optimize With The CSS Contain Property
10.2.2020
There is a growing number of things that we have to do to help the browser achieve for peak performance.
Responsive image syntax has several. For example, needing to tell the browser how large the image will be in our layout with the sizes attribute and how big the images are with w descriptors....
What’s the Difference Between Width/Height in CSS and Width/Height HTML attributes?
24.1.2020
Some HTML elements accept width and height as attributes. Some do not. For example:
<!-- valid, works, is a good idea --<img width="500" height="400" src="..." alt="..."<iframe width="600" height="400" src="..."</iframe<svg width="20" height="20"</svg<!-- not valid...
How many CSS properties are there?
15.1.2020
Tomasz Łakomy posted a joke tweet about naming all the CSS attributes and Tejas Kumar replied with a joke answer, going as far as making an npm module. You can even run a terminal command to see them:
npx get-all-css-properties
You'll get 259 of them. The source code uses the website quackit.com...
A Handy Sass-Powered Tool for Making Balanced Color Palettes
9.12.2019
For those who may not come from a design background, selecting a color palette is often based on personal preferences. Choosing colors might be done with an online color tool, sampling from an image, "borrowing" from favorite brands, or just sort of randomly picking from a color wheel until...
Simplified Fluid Typography
29.11.2019
Fluid typography is the idea that font-size (and perhaps other attributes of type, like line-height) change depending on the screen size (or perhaps container queries if we had them).
The core trickery comes from viewport units. You can literally set type in viewport units (e.g. font-size: 4vw)...
Weekly Platform News: CSS column-span Property, ADA applies to Websites, Auto-generated Image Descriptions
17.10.2019
In this week's roundup: multi-column layouts gain wide support, the ADA means more A11y for retailers, and Google is doing something about all the empty image alt attributes in the wild.
The CSS column-span property will soon be widely supported
The CSS column-span property, which has been...
Wufoo Cracks the Code for Forms So You Don’t Have To
8.10.2019
There was a lot of buzz about forms last week when Jason Grisby pointed to a missing pattern attribute on Chipotle's order form that could have been used to help-through millions of dollars in orders. Adrian Roselli followed that up with the common mistake of forgetting for and id attributes...
Working with Attributes on DOM Elements
30.8.2019
The DOM is just a little weird about some things, and the way you deal with attributes is no exception. There are a number of ways to deal with the attributes on elements. By attributes, I mean things like the id in <div id="cool"></div>. Sometimes you need to set them. Sometimes...
Navbar Nudging on @keyframers
22.8.2019
I got to be the featured guest over on The Keyframers the other day. We looked at a Dribbble shot by Björgvin Pétur Sigurjónsson and then slowly built it, taking some purposeful detours along the way to discuss various tech.
We start by considering doing it entirely in CSS, then go for some light...
Responsive Iframes
25.7.2019
Say you wanted to put the CSS-Tricks website in an <iframe>. You'd do that like this:
<iframe src="https://css-tricks.com"></iframe>
Without any other styling, you'd get a rectangle that is 300x150 pixels in size. That's not even in the User Agent stylesheet, it's just some...
SVG Properties and CSS
13.5.2019
There are many Scalable Vector Graphics (SVG), but only certain attributes can be applied as CSS to SVG. Presentation attributes are used to style SVG elements and can be used as CSS properties. Some of these attributes are SVG-only while others are already shared in CSS, such as font-size...