Search

Nalezeno "Markup": 202

Color Mixing With Animation Composition


Mixing colors in CSS is pretty much a solved deal, thanks to the more recent color-mix() function as it gains support. Pass in two color values — any two color values at all — and optionally set the proportions. background-color: … Color Mixing With Animation Composition originally...

Paragraphs


I sure do love little reminders about HTML semantics, particularly semantics that are tougher to commit to memory. Scott has a great one, beginning with this markup: <pI am a paragraph.</p<spanI am also a paragraph.</span<div … Paragraphs originally published...

HTML Attribute to Allow/Disallow Handwriting Input


A new explainer for a new HTML attribute to handle handwritten inputs. Like this: <input type="text" handwriting="true" ... <input type="text" handwriting="false" ... <textarea handwriting="" ... <!-- evaluates to "true" --<div contenteditable...

The Double Emphasis Thing


I used to have this boss who loved, loved, loved, loved to emphasize words. This was way back before we used a WYSIWYG editors and I’d have to handcode that crap. <pI used to have this … The Double Emphasis Thing originally published on CSS-Tricks, which is part of...

CSS Infinite 3D Sliders


In this series, we’ve been making image sliders with nothing but HTML and CSS. The idea is that we can use the same markup but different CSS to get wildly different results, no matter how many images we toss … CSS Infinite 3D Sliders originally published on CSS-Tricks, which is part of...

Unchain My Inaccessibly-Labelled Heart


Suzy Naschansky from the HTMHell Advent Calendar: <h2 id="article1-heading"All About Dragons</h2<pI like dragons. Blah blah blah blah blah.</p<p<a id="article1-read-more" aria-labelledby="article1-read-more article1-heading"Read more</a</p See that aria-labelledby...

Manuel Matuzovic: max() Trickery


By way of a post by Manuel Matuzović which is by way of a demo by Temani Afif. .wrapper { margin-inline: max(0px, ((100% - 64rem) / 2)); } You’d be doing yourself a favor to read Manuel’s breakdown of … Manuel Matuzovic: max() Trickery originally published on CSS-Tricks, which...

Interpolating Numeric CSS Variables


We can make variables in CSS pretty easily: :root { --scale: 1; } And we can declare them on any element: .thing { transform: scale(--scale); } Even better for an example like this is applying the variable on a user … Interpolating Numeric CSS Variables originally published...

How stroke-dasharray Patterns Work


Say you have a line in SVG: <svg<line x1="0" y1="30" x2="500" y2="30" stroke-color="#f8a100" /</svg You can use the stroke-dasharray property in CSS to make dashes: line { stroke-dasharray: 5; } That 5 value is a relative unit based … How stroke-dasharray Patterns...

Please Give Me Some Space


There’s all kinds of ways to do that. Some more advisable and better-suited for certain situations than others, of course. We could do it directly in HTML: <pWe go from one line...<br<brdown a couple more.</p But that’s … Please Give Me Some Space originally...

Trailing Slashes on URLs: Contentious or Settled?


A fun deep dive from Zach. Do you have an opinion on which you should use? 1) https://website.com/foo/ 2) https://websites.com/foo The first option has a “trailing slash.” The second does not. I’ve always preferred this thinking: you use a trailing … Trailing Slashes...

Multi-Value CSS Properties With Optional Custom Property Values


Imagine you have an element with a multi-value CSS property, such as transform: optional custom property values: .el { transform: translate(100px) scale(1.5) skew(5deg); } Now imagine you don’t always want all the transform values to be applied, so some … Multi-Value CSS Properties With...

No Motion Isn’t Always prefers-reduced-motion


There is a code snippet that I see all the time when the media query prefers-reduced-motion is talked about. Here it is: @media (prefers-reduced-motion: reduce) { * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms...

How to Cycle Through Classes on an HTML Element


Say you have three HTML classes, and a DOM element should only have one of them at a time: <div class="state-1"</div<div class="state-2"</div<div class="state-3"</div Now your job is to rotate them. That is, cycle through classes … How to Cycle Through Classes on...

Eye Droppin’


Quick hits! There is a new web API called EyeDropper: if ('EyeDropper' in window) { const eyeDropper = new EyeDropper(); try { // This has gotta be triggered by a user interaction, // so consider this pseudo-code. const result …

When is it “Right” to Reach for contain and will-change in CSS?


I’ve got some blind spots in CSS-related performance things. One example is the will-change property. It’s a good name. You’re telling the browser some particular property (or the scroll-position or content) uh, will, change: .el { will-change: opacity; … The post When...

CSS “decorations”


A reader wrote to me the other day asking about this bit of CSS they came across in Wikipedia’s Common.css: .mw-collapsible-leftside-toggle .mw-collapsible-toggle { /* @noflip */ float: left; /* @noflip */ text-align: left; } What’s that @noflip business? 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