Search

Nalezeno "css-tricks": 2942

A Guide to the Responsive Images Syntax in HTML


This guide is about the HTML syntax for responsive images (and a little bit of CSS for good measure). We'll go over srcset and , plus a whole bunch of things to consider to help you get the best performance and design control from your images. The post A Guide to the Responsive Images Syntax...

CSS Tips for New Devs


Amber Wilson has some CSS Tips for New Devs, like: It’s not a good idea to fix shortcomings in your HTML with CSS. Fix your HTML first! And… You can change CSS right in your browser’s DevTools (to open them, right-click the browser window and choose “inspect”...

Using Structured Data to Enhance Search Engine Optimization


SEO is often considered the snake oil of the web. How many times have you scrolled through attention-grabbing headlines on know how to improve your SEO? Everyone and their uncle seems to have some “magic” cure to land high in search results and turn impressions into conversions. Sifting through...

Framer Web


The prototyping app Framer just launched the web version of their design tool and it looks pretty darn neat. I particularly love the design of the marketing site that explains how to use Framer and what sets it apart from other design tools. They have a ton of examples that you can pop open...

Block Links: The Search for a Perfect Solution


I was reading this article by Chris where he talks about block links — you know, like wrapping an entire card element inside an anchor — being a bad idea. It’s bad accessibility because of how it affects screen readers. And it’s bad UX because it prevents simple user tasks, like selecting text. But...

How to Convert a Date String into a Human-Readable Format


I’ll be the first to admit that I’m writing this article, in part, because it’s something I look up often and want to be able to find it next time. Formatting a date string that you get from an API in JavaScript can take many shapes — anything from loading all of Moment.js to have...

“The Modern Web”


A couple of interesting articles making the rounds: Tom MacWrite: Second-guessing the modern web Rich Harris: In defense of the modern web I like Tom’s assertion that React (which he’s using as a stand-in for JavaScript frameworks in general) has an ideal usage: There is a sweet spot...

The Fastest Google Fonts


When you use font-display: swap;, which Google Fonts does when you use the default &display=swap part of the URL , you’re already saying, “I’m cool with FOUT,” which is another way of saying web text is displayed right away, and when the web font is ready...

A “new direction” in the struggle against rightward scrolling


You know those times you get a horizontal scrollbar when accidentally placing an element off the right edge of the browser window? It might be a menu that slides in or the like. Sometimes we to overflow-x: hidden; on the body to fix that, but that can sometimes wreck stuff like position:...

Flexbox-like “just put elements in a row” with CSS grid


It occurred to me while we were talking about flexbox and gap that one reason we sometimes reach for flexbox is to chuck some boxes in a row and space them out a little. My brain still reaches for flexbox in that situation, and with gap, it probably will continue to do so. It’s worth noting...

Roll Your Own Comments With Gatsby and FaunaDB


If you haven’t used Gatsby before have a read about why it’s fast in every way that matters, and if you haven’t used FaunaDB before you’re in for a treat. If you’re looking to make your static sites full blown Jamstack applications this is the back...

Radio Buttons Are Like Selects; Checkboxes Are Like Multiple Selects


I was reading Anna Kaley’s “Listboxes vs. Dropdown Lists” post the other day. It’s a fairly straightforward comparison between different UI implementations of selecting options. There is lots of good advice there. Classics like that you should use radio buttons (single...

WordPress Block Transforms


This has been the year of Gutenberg for us here at CSS-Tricks. In fact, that’s a goal we set at the end of last year. We’re much further along that I thought we’d be, authoring all new content in the block editor¹, enabling the block editor for all content now. That means when...

How to Build a Chrome Extension


I made a Chrome extension this weekend because I found I was doing the same task over and over and wanted to automate it. Plus, I’m a nerd during a pandemic, so I spend my weird pent-up energy building things. I’ve made five Chrome extensions with that energy, yet I still find it hard...

User agents


Jeremy beating the classic drum: For web development, start with HTML, then CSS, then JavaScript (and don’t move on to JavaScript too quickly—really get to grips with HTML and CSS first). And then… That’s assuming you want to be a good well-rounded web developer. But it might be that...

Using BugHerd to Track Visual Feedback on Websites


BugHerd is about collecting visual feedback for websites. If you’re like me, you’re constantly looking at your own websites and you’re constantly critiquing them. I think that’s healthy. Nothing gets better if you look at your own work and consider it perfectly finished....

First Steps into a Possible CSS Masonry Layout


It’s not at the level of demand as, say, container queries, but being able to make “masonry” layouts in CSS has been a big ask for CSS developers for a long time. Masonry being that kind of layout where unevenly-sized elements are layed out in ragged rows. Sorta like a typical...

Nahoru
Tento web používá k poskytování služeb a analýze návštěvnosti soubory cookie. Používáním tohoto webu s tímto souhlasíte. Další informace