Quantcast
Channel: Tobias Ahlin
Browsing latest articles
Browse All 52 View Live

Common CSS Flexbox Layout Patterns with Example Code

.flexbox-banner-logo { width: 100px; height: 100px; display: inline-block; position: relative; } .flexbox-box { background-color: #fff; width: 100%; height: 100%; position: absolute; top: 0; left: 0;...

View Article



CSS masonry with flexbox, :nth-child(), and order

.masonry-banner-logo { width: 100px; height: 100px; display: inline-block; position: relative; } .masonry-box { background-color: #fff; width: 100%; height: 100%; position: absolute; top: 0; left: 0;...

View Article

Breaking to a new row with flexbox

.flexbox-break-banner-logo { margin-top: 20px; width: 100px; height: 100px; display: inline-block; position: relative; } .flexbox-break-box { background-color: #fff; width: 100%; height: 100%;...

View Article

Cheat sheet for moving from jQuery to vanilla JavaScript

.blog-banner-jquery { width: 200px; height: 100px; position: relative; z-index: 3; } .blog-banner-jquery-hole { background-color: rgba(0,0,0,0.3); width: 90px; height: 90px; border-radius: 50%;...

View Article

Smoother & sharper shadows with layered box-shadows

DefaultSmooth .blog-traditional-shadow-box { background-color: #fff; line-height: 76px; border-radius: 3px; color: #333; margin-right: 15px; display: inline-block; width: 100px; height: 80px;...

View Article


Chaining styles with a JavaScript Proxy

.post-chain-wrapper { border-radius: 50%; padding: 25px; background-color: #000; height: 44px; width: 44px; margin: 0 auto; } .post-chain-svg { max-height: 100%; } One of the delights of working with...

View Article

Image may be NSFW.
Clik here to view.

A brief introduction to A/B-testing

A/B-testing is a guiding compass for making product decisions. More technically, it’s a method for quantifying the impact of product variations. The process can’t tell us if one variation is...

View Article

Image may be NSFW.
Clik here to view.

Selecting previous siblings with CSS :has()

.item { border-radius: 3px; background-color: #A2CBFA; border: 1px solid #4390E1; box-sizing: border-box; width: 20px; height: 20px; margin: 0 20px 20px; box-shadow: 0 2px 2px rgba(0,90,250,0.05), 0...

View Article


Image may be NSFW.
Clik here to view.

Hiding empty elements with CSS :empty and :has()

.item { border-radius: 3px; background-color: #A2CBFA; border: 1px solid #4390E1; box-sizing: border-box; padding: 10px; font-size: 14px; font-weight: 600; color: #fff; flex-grow: 1; flex-basis: 50%;...

View Article


Image may be NSFW.
Clik here to view.

Responsive type scales with composable CSS utilities

:root { --min-size: 16; --max-size: 16; --viewport-min: 320; --viewport-max: 2400; --container-min: 320; --container-max: 2400; } .h1, .h2, .h3, .h4 { --font-size: calc(var(--min-size) * 1px +...

View Article
Browsing latest articles
Browse All 52 View Live




Latest Images