Search

Nalezeno "QR code": 1615

Want to get better at code? Teach someone CSS.


A friend of mine recently asked me to teach her to code. She was an absolute beginner, having no idea what coding really involves. I decided to start where I started: HTML and CSS. Using CodePen, we started forking Pens and altering them. Soon, a learning path started to unravel. The aim of this...

The GitHub Profile Trick


Monica Powell shared a really cool trick the other day: The profile README is created by creating a new repository that’s the same name as your username. For example, my GitHub username is m0nica so I created a new repository with the name m0nica. Now the README.md from that repo is essentially...

Bold on Hover… Without the Layout Shift


When you change the font-weight of a font, the text will typically cause a bit of a layout shift. That’s because bold text is often larger and takes up more space. Sometimes that doesn’t matter, like a vertical stack of links where the wider/bolder text doesn’t push anything...

Accordion Rows in CSS Grid


I’d bet grid-template-columns is used about 10× more than grid-template-rows, but maybe everyone has just been missing out. Eric Meyer chucks a bunch of row lines onto his main site layout grid like this: grid-template-rows: repeat(7, min-content) 1fr repeat(3, min-content); That way, if...

Position Vertical Scrollbars on Opposite Side with CSS


Fair warning: I can’t say I recommend this in general because it breaks a very strong expectation of where scrollbars are, which are useful for a lots of folks, not to mention, a core accessibility feature for many. But it is a fascinating CSS trick and the web is a big place with...

Pausing a GIF with details/summary


Steve Faulkner has a clever idea here. You can show an (animated) GIF and overlay a pause/play button on top of it — which is really a <details>/<summary> element. When toggled, a (non-animated) JPG inside covers the GIF, effectively “pausing” it. Adrian Roselli calls...

Using Flexbox and text ellipsis together


You can truncate a single line of text with an ellipsis (…) fairly easily with text-overflow and a few friends. But, as you might expect, that truncation happens at the end of the line of text. What if you want to truncate content in the middle? Leonardo Faria details good use cases for this...

When do you use inline-block?


The inline-block value for display is a classic! It’s not new and browser support is certainly not something you need to worry about. I’m sure many of us reach for it intuitively. But let’s put a point on it. What is it actually useful for? When do you pick it over other, perhaps...

Levels of Fix


On the web, we have the opportunity to do work that fixes things for people. It’s fascinating to me how different the scope of those fixes can be. Consider the media query prefers-reduced-motion. Eric wrote: I think it’s also worth pointing out the true...

Backdrop Filter effect with CSS


I love these little posts where some tricky-looking design is solved by a single line of CSS using a little-known property. In this case, the design is a frosted glass effect and the CSS property is backdrop-filter. The approach? Easy peasy: .container { backdrop-filter: blur(10px); } The...

Irregular-shaped Links with Subgrid


Michelle Barker covers a situation where you need offset rectangles part of a clickable area. The tricky part is having just the rectangles be clickable. That rules out using some parent element and making the whole larger encompassing rectangle clickable, which is a common (but equally tricky)...

Lazy Loaded Prefill Embeds


Lemme sum this up: CodePen has Embedded Pens. Build a Pen on CodePen, embed it on any other site. We also offer Prefill Embeds, which remove that first step. With Prefill Embeds, the Pen doesn’t need to exist on CodePen at all. You pass in the code and settings you want to appear in...

Memorize Scroll Position Across Page Loads


Hakim El Hattab tweeted a really nice little UX enhancement for a static site that includes a scrollable sidebar of navigation. ???? If you've got a static site with a scrollable sidebar, it really helps to memorize the scroll position across page loads. (left is default, right memorized)...

How to delete all node_modules directories from your computer


Nice tip from Chris Ferdinandi: My node_modules directories contained 50mb of stuff on the small side, and over 200mb of files in some cases. Over a few dozen projects, that really adds up! Two dozen projects with 200 MB worth of node_modules? That’s nearly 5 GB of space for...

Get Worldwide Postal Code Data with Zip Code API (Sponsored)


Accurate shipping and location information is well worth the price you need to pay for it. You can sell that information, you can target consumers to perfection, and save yourself loads of frustration when it comes to shipping. Creating your own location API isn’t worth the time — there...

Fluid Images in a Variable Proportion Layout


Creating fluid images when they stand alone in a layout is easy enough nowadays. However, with more sophisticated interfaces we often have to place images inside responsive elements, like this card: For now, let’s say this image is not semantic content, but only decoration. That’s...

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