Search

Nalezeno "QR code": 1615

4 Ways to Animate the Color of a Text Link on Hover


Let’s create a pure CSS effect that changes the color of a text link on hover… but slide that new color in instead of simply swapping colors. There are four different techniques we can use to do this. Let’s look at those while being mindful of important things, like accessibility, performance,...

Considerations for Creating a Card Component


Here's a Card component in React: const Card = props ={ return( <div className="card"<h2{props.title}</h2<p{props.content}</p</div) } It might be pretty useful! If you end up using this thing hundreds of times, now you have the ability to refactor a little bit of HTML...

Unfortunately, clip-path: path() is Still a No-Go


I was extremely excited when I first heard that clip-path: path() was coming to Firefox. Just imagine being able to easily code a breathing box like the one below with just one HTML element and very little CSS without needing SVG or a huge list of points inside the polygon function! Chris...

Selectors Explained


Have you ever found yourself either writing a CSS selector that winds up looking confusing as heck, or seen one while reading through someone's code? That happened to me the other day. Here's what I wrote: .site-footer__nav a:hover svg ellipse:first-child { } At the end of it, I honestly couldn't...

HTML: The Inaccessible Parts


<input type="number", <input type="date", <input type="search", <select multiple, <progress, <meter, <dialog, <details<summary, <video, <div onclick, <div aria-label, <a href<divBlock Links</div</a, aria-controls...

When CSS Blocks


Tim Kadlec: One particular pattern [for loading non-critical CSS] I’ve seen is the preload/polyfill pattern. With this approach, you load any stylesheets as preloads instead, and then use their onload events to change them back to a stylesheet once the browser has them ready. So you're...

Chameleonic Header


Nice demo from Sebastiano Guerriero. When a fixed-position header moves from overlapping differently-colored backgrounds, the colors flop out to be appropriate for that background. Sebastiano's technique is very clever, involving multiple copies of the header within each section (where the copies...

In-Browser Performance Linting With Feature Policies


Here’s a neat idea from Tim Kadlec. He uses the Modheader extension to toggle custom headers in his browser. It also lets him see when images are too big and need to be optimized in some way. This is a great way to catch issues like this in a local environment because browsers will throw an error...

Fixed Headers and Jump Links? The Solution is scroll-margin-top


The problem: you click a jump link like <a href="#header-3">Jump</a> which links to something like <h3 id="header-3">Header</h3>. That's totally fine, until you have a position: fixed; header at the top of the page obscuring the header you're trying to link to! Fixed...

Inspiring high school students with HTML and CSS


Here’s a heartwarming post from Stephanie Stimac on her experience teaching kids the very basics of web development: [...] the response from that class of high school students delighted me and grounded me in a way I haven't experienced before. What I view as a simple code was absolute magic...

How to Find Your Nearest Bitcoin ATM


Cryptocurrency markets have experienced a few intensive weeks since the start of the year that took prices to 2020 highs in mid-February. The overall bullish sentiment is attracting more interest towards the crypto space. There are many ways to get started with Bitcoin but one the most accessible...

Animate SVG Path Changes in CSS


Every once in a while I'm motivated to attempt to draw some shapes with <path>, the all-powerful drawing syntax of SVG. I only understand a fragment of what it all can do, but I know enough to be dangerous. All the straight-line syntax commands (like L) are pretty straightforward and I find...

Add Background Colors to SVGs Using the “rect” Element


The advantages of using SVGs in web development are well known. SVGs are small in size, can be made quite accessible, are scalable while maintaining their quality, and can be animated. Still, there is a learning curve. Things, like the syntax of SVG, can be a little tricky and having to hand-alter...

Footnote Characters


They are special superset numbers that are sometimes perfect for footnotes. Here they are: ¹ ² ³ ⁴ ⁵ ⁶ ⁷ ⁸ ⁹ I generally prefer to superscript the number myself, like: <pThis next word<sup1</suphas a footnote.</p You'd probably add an anchor link around that as well to link to an...

Do This to Improve Image Loading on Your Website


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...

monica.css


Monica Dinculescu: I don’t want every possible padding and margin and colour and flexbox configuration in the world. I just want the ones that I know I end up using in every project. So here is monica.css: my very own CSS framework, which I copy paste at the beginning of every CSS file and take...

Solving Sticky Hover States with @media (hover: hover)


Mezo Istvan does a good job of covering the problem and a solution to it in a blog post on Medium¹. If you tap on something that has a :hover state but you don't leave the page then, on a mobile device, there is a chance that :hover state "sticks." You'll see this with stuff like jump-links used...

Web Component for a Code Block


We'll get to that, but first, a long-winded introduction. I'm still not in a confident place knowing a good time to use native web components. The templating isn't particularly robust, so that doesn't draw me in. There is no state management, and I like having standard ways of handling that. If...

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