Web Development

Web Development Latest News

css-tricks.com

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 headers have a nasty habit of hiding the element you’re trying to link …

css-tricks.com

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 to them. And for all …

css-tricks.com

iOS 13 Design Guidelines, Templates, and Downloads

Erik Kennedy wrote up a bunch of design advice for designing for the iPhone. Like Apple’s Human Interface Guidelines, only illustrated and readable, says Erik. This is mostly for native iOS apps kinda stuff, but it makes me wonder how much of this is expected when doing a mobile Progressive Web App. On one hand, …

css-tricks.com

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 the curved Q …

css-tricks.com

A Guide to Console Commands

The developer’s debugging console has been available in one form or another in web browsers for many years. Starting out as a means for errors to be reported to the developer, its capabilities have increased in many ways; such as automatically logging information like network requests, network responses, security errors or warnings. There is also …

css-tricks.com

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 SVG code sometimes …

css-tricks.com

Seen by Indeed

Are you looking for a tech job where you clock in, or for a career where you’ll be seen? Seen by Indeed is a matching service for software engineers, product managers and other tech pros that sorts through thousands of companies — like Twilio, Overstock, VRBO, and PayPal — and matches tech talent like you to …

css-tricks.com

Footnote Characters

There are special superset number characters that are sometimes perfect for footnotes. Here they are: ¹ ² ³ ⁴ ⁵ ⁶ ⁷ ⁸ ⁹ I generally prefer to superscript the number myself, like:

css-tricks.com

Do This to Improve Image Loading on Your Website

In the video embedded below, Jen Simmons explains how to improve image loading by 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. …

css-tricks.com

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 it …

css-tricks.com

Same HTML, Different CSS

Ahmad Shadeed covers the idea of a card component that has a fixed set of semantic HTML with some BEMy classes on it. There is a title, author, image, and tags. Then he redesigns the card into five totally different designs without touching any of the HTML just the CSS. If this is an ah-ha …

css-tricks.com

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 as tabs or buttons that trigger on-page functionality.

css-tricks.com

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 I’m using another library …

css-tricks.com

Moving from Vanilla JavaScript to a Reusable Vue Component

I recently wrote an article explaining how you can create a countdown timer using HTML, CSS and JavaScript. Now, let’s look at how we can make that a reusable component by porting it into Vue using basic features that the framework provides. Why do this at all? Well there are few reasons, but two stand out in particular: Keeping UI in sync with the timer state: If you look …

css-tricks.com

Blame the implementation, not the technique

I’m not sure we’ve gotten much better at this since Tim Kadlec wrote this in 2012: Stop me if you’ve heard this one before. “Responsive design is bad for performance.”“User agent detection is bad. Don’t segment the web.”“Hybrid apps don’t work as well as native apps.”“CSS preprocessors shouldn’t be used because they create bloated CSS.” …

css-tricks.com

Listen to your web pages

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 to hear it doing stuff.

css-tricks.com

“CSS4” Update

Since I first chimed in on the CSS4¹ thing, there’s been tons of more discussion on it. I’m going to round up my favorite thoughts from others here. There is an overwhelming amount of talk about this, so I’m going to distill it here down as far as I can, hopefully making it easier to …

css-tricks.com

Creating a Details Element That Opens But Never Closes

The <details> and <summary> elements in HTML are useful for making content toggles for bits of text. By default, you see the <summary> element with a toggle triangle (▶︎) next to it. Click that to expand the rest of the text inside the <details> element. But let’s say you want to be able to click …

css-tricks.com

While You Weren’t Looking, CSS Gradients Got Better

One thing that caught my eye on the list of features for Lea Verou’s conic-gradient() polyfill was the last item: Supports double position syntax (two positions for the same color stop, as a shortcut for two consecutive color stops with the same color) Surprisingly, I recently discovered most people aren’t even aware that double position …

css-tricks.com

Why JavaScript is Eating HTML

Web development is always changing. One trend in particular has become very popular lately, and it fundamentally goes against the conventional wisdom about how a web page should be made. It is exciting for some but frustrating for others, and the reasons for both are difficult to explain. A web page is traditionally made up …

css-tricks.com

A Headless CMS for You and Your Web Development Agency

Storyblok is a headless but component-based CMS with a built-in live-preview. You can use it for building fast and reliable websites and power native apps with your favorite technology. Let us start with the basics and what a headless CMS is: A headless content management system is a back-end only content management system (CMS) built from …

css-tricks.com

2020 Stack

In an article with the most clickbaity article ever, Joe Honton does a nice job of talking about the evolving landscape of web development. “Full-stack” perhaps had its day as a useful term, but since front-end development touches so many parts of the stack now, it’s not a particularly useful term. Joe himself did a …

css-tricks.com

Toward Responsive Elements

Hot news from Brian Kardell, regarding what we’ve been referring to as “container queries,” the most hotly requested feature in CSS: There does seem to be some general agreement on at least one part of what I am going to call instead “Responsive Design for Components” and that is that flipping the problem on its …

css-tricks.com

Building an Images Gallery using PixiJS and WebGL

Sometimes, we have to go a little further than HTML, CSS, and JavaScript to create the UI we need, and instead use other resources, like SVG, WebGL, canvas, and others. For example, the most amazing effects can be created with WebGL, because it’s a JavaScript API designed to render interactive 2D and 3D graphics within any compatible web browser, allowing GPU-accelerated image …