Search

Nalezeno "QR code": 1615

What Does `playsinline` Mean in Web Video?


I got myself confused about this the other day, went around searching for an answer and came up empty on finding something clear. The answer actually is quite clear and I feel a little silly for not knowing it. With it in place, like this: <video src="..." controls playsinline</video Mobile...

Flexbox and absolute positioning


Chen Hui Jing notes that when you absolutely position a flex item, it's no longer part of the flex layout. Except... it kinda is a little bit. If you make the child position: absolute; but don't apply any top/right/bottom/left properties, then flexbox alignment will still apply to it. It's odd...

A Complete Guide to calc() in CSS


CSS has a special calc() function for doing basic math. Here's an example: .main-content { /* Subtract 80px from 100vh */ height: calc(100vh - 80px); } In this guide, let's cover just about everything there is to know about this very useful function. calc() is for values The only place you...

Stop Using “Dropdown”


Adrian Roselli notes that it might actually mean: A <select> menu An ARIA Listbox, Combobox, Menu, or Disclosure Widget An input with a <datalist> An input with autocomplete A <details><summary> block An accordion Flyout navigation In my own usage, I tend to mean...

How to Make Repeating Border Images


I just saw this cool little site from Max Bittker: broider. You design an image on a 9-slice grid (except the middle part) and it will produce an image for you to use with border-image along with the CSS to copy and paste. Check out my little design: CodePen Embed Fallback The areas of the image...

Using the HTML title attribute


 Steve Faulkner: User groups not well served by use of the title attribute • Mobile phone users.• Keyboard only users.• Screen magnifier users.• Screen reader users.• Users with fine motor skill impairments.• Users with cognitive impairments. Sounds like in 2020, the only useful thing the title...

Careful with Nested `display: grid; height: 100%;`


It's not every day you can feel CSS be slow at something. Reddit user jgbbrd discovered nesting grid containers that all have 100% height can cause many-seconds of rendering delay. Probably not something you'll ever have to worry about, but still, interesting. From the comments: What a funny...

Sass !default and themeable design systems


This is a great blog post from Brad Frost where he walks us through an interesting example. Let’s say we’re making a theme and we have some Sass like this: .c-text-input { background-color: $form-background-color; padding: 10px } If the $form-background-color variable isn’t defined then...

Fluid Width Video


IN A WORLD of responsive and fluid layouts on the web, ONE MEDIA TYPE stands in the way of perfect harmony: video. There are lots of ways in which video can be displayed on your site. You might be self-hosting the video and presenting it via the HTML5 <video tag. You might...

Block Links Are a Pain (and Maybe Just a Bad Idea)


As we noted in our complete guide, you can put an <a href=""> link around whatever chunks of HTML you like. Let's call that a "block link." Like you are wanting to link up an entire "Card" of content because it makes a big clickable target. <a href="/article/"<!-- display: block;...

Adventures in CSS Semi-Transparency Land


Recently, I was asked to make some tweaks to a landing page and, among the things I found in the code, there were two semitransparent overlays — both with the same RGB values for the background-color — on top of an image. Something like this: <img src='myImage.jpg'/> <div...

Use a:visited in your CSS stylesheet


Evert Pot: Unfortunately, when setting a new color (e.g. a { color: #44F }) the ‘purple visited link’ feature also gets disabled. I think this is a shame, as there’s so many instances where you’re going through a list of links and want to see what you’ve seen before. The 2 examples I ran into...

What to Use Instead of Number Inputs


You might reach for <input type="number> when you're, you know, trying to collect a number in a form. But it's got all sorts of issues. For one, sometimes what you want kinda looks like a number, but isn't one (like how a credit card number has spaces), because it's really just a string...

Currying in CSS


Funny timing on this I was just looking at the website for Utopia (which is a responsive type project which I hate to admit I don't fully understand) and I came across some CSS they show off that looked like this: :root { --fluid-max-negative: (1 / var(--fluid-max-ratio)...

The 3 Laws of Serverless


Burke Holland thinks that to "build applications without thinking about servers" is a pretty good way to describe serverless, but... Nobody really thinks about servers when they are writing their code. I mean, I doubt any developer has ever thrown up their hands and said “Whoa, whoa, whoa. Wait...

Animating CSS Width and Height Without the Squish Effect


The first rule of animating on the web: don't animate width and height. It forces the browser to recalculate a bunch of stuff and it's slow (or "expensive" as they say). If you can get away with it, animating any transform property is faster (and "cheaper"). Butttt, transform can be tricky. Check...

Collective #595


Variable Fonts Primer * Cannon-es and use-cannon * Faux Code Generator * Learn Box Alignment Collective #595 was written by Mary Lou and published on Codrops

What React Does (and Doesn’t Do)


With a name as big as React, it's bound to cause some Stream-Crossing Confusion, as I like to call it. How do you center a <div> in React? Dave Ceddia: React cares exactly zero about styling. Think of it as generating the barebones HTML. React will put elements on the page, but everything...

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