October 2026

How to Create a Parallax Scrolling Effect With CSS Only (No JavaScript)

A CSS parallax effect happens when the background of a page moves slower than the content in front of it while you scroll, which tricks the eye into seeing depth on a flat screen. Most tutorials solve this with a JavaScript library that listens to every scroll event, recalculates positions and quietly destroys your Interaction to Next Paint score. See geeksforgeeks.org for their take. You do not need any of that. In 2026, the browser can handle parallax natively with three techniques: background-attachment, 3D transforms with perspective and transform-style, and scroll-driven animations. This guide gives you working code for each one, plus the mobile fallbacks and accessibility rules that almost every other tutorial skips. The three CSS-only parallax methods compared Method Best for Difficulty Support Performance background-attachment: fixed Hero banners, section dividers Beginner Universal on desktop, broken on iOS Can trigger repaints on large images 3D transforms (perspective + translateZ) Multi-layer scenes, different speeds per layer Intermediate Every modern browser Excellent, GPU composited Scroll-driven animations (animation-timeline) Precise control, any property, modern sites Intermediate Chromium, Safari 26+, Firefox (recent versions) Excellent, runs off the main thread Method 1: the two-line parallax hero with background-attachment This is the fastest way to get a parallax hero online. The background image stays locked to the viewport while the section scrolls over it, so the image appears to move slower than the page. HTML <section class=”parallax-hero”> <div class=”parallax-hero__content”> <h1>Build faster interfaces</h1> <p>No JavaScript, no scroll listeners, no layout thrashing.</p> </div> </section> <section class=”content”> <p>Your regular page content goes here.</p> </section> CSS .parallax-hero { min-height: 100svh; display: grid; place-items: center; background-image: linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.45)), url(“/img/hero-1920.webp”); background-size: cover; background-position: center; background-repeat: no-repeat; background-attachment: fixed; } .parallax-hero__content { color: #fff; text-align: center; max-width: 40rem; padding: 2rem; } /* Fallback: iOS Safari and touch devices */ @media (max-width: 768px), (hover: none) and (pointer: coarse) { .parallax-hero { background-attachment: scroll; } } /* Accessibility: respect motion preferences */ @media (prefers-reduced-motion: reduce) { .parallax-hero { background-attachment: scroll; } } Why the fallback matters: iOS Safari has never implemented background-attachment: fixed the way desktop browsers do. Without the media query above, the image is scaled to the full document height and looks zoomed in or jumps as the address bar collapses. Switching to scroll on touch devices gives you a clean static background instead of a broken one. Bonus: a parallax content divider The same idea works beautifully as a narrow band between two text sections. Keep it short so the page keeps its rhythm. .parallax-divider { min-height: clamp(220px, 45vh, 420px); background-image: url(“/img/divider-1600.webp”); background-size: cover; background-position: center; background-attachment: fixed; display: grid; place-items: center; } .parallax-divider blockquote { color: #fff; font-size: clamp(1.25rem, 3vw, 2rem); text-shadow: 0 2px 12px rgba(0,0,0,.6); max-width: 45ch; text-align: center; } @media (max-width: 768px), (prefers-reduced-motion: reduce) { .parallax-divider { background-attachment: scroll; } } Method 2: true multi-layer parallax with perspective and transform-style If you want several layers moving at different speeds (a sky, mountains, trees, foreground text), background-attachment is not enough. The classic pure CSS solution uses a 3D scene: you push layers away from the camera on the Z axis, and because they are further away, they appear to move slower when the scroller moves. The math you need When you push an element back with translateZ, it also shrinks. You compensate with scale(): scale = 1 + (translateZ * -1) / perspective perspective: 10px and translateZ(-10px) gives scale(2) and a layer moving at roughly half speed perspective: 10px and translateZ(-20px) gives scale(3) and a layer moving at roughly one third speed translateZ(0) means normal speed, which is your foreground HTML <div class=”parallax”> <section class=”parallax__group”> <div class=”parallax__layer parallax__layer–back”> <img src=”/img/mountains.webp” alt=”” width=”1920″ height=”1080″> </div> <div class=”parallax__layer parallax__layer–base”> <h1>Depth without a single line of JS</h1> </div> </section> <section class=”parallax__group parallax__group–plain”> <p>Normal scrolling content.</p> </section> </div> CSS .parallax { height: 100svh; overflow-x: hidden; overflow-y: auto; perspective: 10px; perspective-origin: 0 0; /* keeps native scroll snapping and momentum intact */ scroll-behavior: smooth; } .parallax__group { position: relative; height: 100svh; transform-style: preserve-3d; } .parallax__layer { position: absolute; inset: 0; transform-origin: 0 0; } .parallax__layer–back { transform: translateZ(-10px) scale(2); z-index: 1; } .parallax__layer–base { transform: translateZ(0); z-index: 2; display: grid; place-items: center; color: #fff; } .parallax__layer img { width: 100%; height: 100%; object-fit: cover; } @media (prefers-reduced-motion: reduce) { .parallax { perspective: none; } .parallax__layer–back { transform: none; } } Things to watch with the 3D method The scroll container is the element with perspective, not the body. Anchor links, sticky headers and position: fixed elements behave differently inside it, so test your navigation. Stacking order is controlled by z-index inside each group. A layer pushed back on Z will still paint above another layer if its z-index is higher. Do not nest transforms on parents. Any ancestor with its own transform, filter or will-change creates a new containing block and flattens your 3D scene. Method 3: scroll-driven animations, the modern way Scroll-driven animations are the cleanest option available today. You write a normal @keyframes rule and then tell the browser to drive it with scroll progress instead of time, using animation-timeline. The animation runs on the compositor, so it does not block the main thread the way a JavaScript scroll handler does. Parallax hero with view() @keyframes parallax-shift { from { transform: translate3d(0, -12%, 0); } to { transform: translate3d(0, 12%, 0); } } .hero { position: relative; min-height: 100svh; overflow: hidden; isolation: isolate; } .hero__bg { position: absolute; inset: -15% 0; z-index: -1; background: url(“/img/hero-1920.webp”) center / cover no-repeat; } @supports (animation-timeline: view()) { .hero__bg { animation: parallax-shift linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; } } @media (prefers-reduced-motion: reduce) { .hero__bg { animation: none; } } Whole-page background driven by scroll() Use scroll() when you want an element to react to the progress of the nearest scroller rather than its own visibility. @keyframes drift { to { background-position: center 70%; } } .page-bg { position: fixed; inset: 0; z-index: -1; background: url(“/img/texture.webp”) center 30% / cover no-repeat; animation: drift linear both; animation-timeline: scroll(root block); } Wrapping the rules in

How to Create a Parallax Scrolling Effect With CSS Only (No JavaScript) Read More »

How to Add a Wishlist to WooCommerce Without a Plugin (Code Tutorial)

Short answer: you do not need a wishlist plugin. With roughly 150 lines of PHP, a small vanilla JavaScript file and one shortcode, you can ship a save-for-later wishlist in WooCommerce that stores data in user meta for logged-in customers and in a cookie for guests. No extra database tables, no jQuery dependency, no third-party scripts loading on every page of your store. This tutorial gives you the complete, production-ready code: the button, the AJAX toggle, the storage layer, the wishlist page template, the menu counter and the trick that keeps everything working behind full page caching. Why build a WooCommerce wishlist without a plugin? Most wishlist plugins do far more than you need. A typical free wishlist plugin will: Enqueue its own CSS and JS on every single page, including the checkout and blog posts Create custom database tables and cron jobs for price-drop emails you will never enable Register dozens of options, admin pages and upsell notices Add render-blocking requests that hurt your Largest Contentful Paint and Interaction to Next Paint scores Lock your data in a proprietary structure that is painful to migrate later A custom implementation loads two small files only where they are needed, stores product IDs in a format you control, and takes about 30 minutes to install. You own the code, so nothing breaks on the next plugin update. The point is broken down further in this analysis. What we are going to build Feature How it works Save / remove button Hooked into the shop loop and the single product summary Logged-in storage A single _exp_wishlist user meta row containing an array of product IDs Guest storage A JSON cookie, merged into the account on login No page reload admin-ajax.php endpoint protected by a nonce Wishlist page [exp_wishlist] shortcode with add-to-cart and remove actions Header counter [exp_wishlist_count] shortcode updated live in JavaScript Cache friendly A tiny REST endpoint that rehydrates the button state after a cached HTML response Prerequisites WooCommerce installed and active, running on a recent WordPress release (tested on current versions as of September 2026) A child theme or, even better, a site-specific plugin in wp-content/mu-plugins/ so the code survives a theme change FTP or file manager access, plus a staging site if the store is live Basic comfort with PHP and browser dev tools Step 1: Create a safe place for the code Do not paste this into a parent theme functions.php. Create the file wp-content/mu-plugins/exp-wishlist.php and start it with a header: <?php /** * Plugin Name: EXP Lightweight Wishlist * Description: WooCommerce save-for-later wishlist with no third-party plugin. * Version: 1.0.0 */ if ( ! defined( ‘ABSPATH’ ) ) { exit; } define( ‘EXP_WISHLIST_META’, ‘_exp_wishlist’ ); define( ‘EXP_WISHLIST_COOKIE’, ‘exp_wishlist’ ); Everything below goes into that same file. If you prefer a child theme, drop the header comment and paste the functions into functions.php instead. Step 2: The storage layer (user meta plus guest cookie) Two helpers do all the work: one reads the list, one writes it. Product IDs are always cast to integers and deduplicated, which removes an entire class of security and data-integrity bugs. /** * Return the current wishlist as an array of product IDs. */ function exp_get_wishlist() { if ( is_user_logged_in() ) { $ids = get_user_meta( get_current_user_id(), EXP_WISHLIST_META, true ); } elseif ( ! empty( $_COOKIE[ EXP_WISHLIST_COOKIE ] ) ) { $ids = json_decode( wp_unslash( $_COOKIE[ EXP_WISHLIST_COOKIE ] ), true ); } else { $ids = array(); } if ( ! is_array( $ids ) ) { $ids = array(); } $ids = array_values( array_unique( array_filter( array_map( ‘absint’, $ids ) ) ) ); return apply_filters( ‘exp_wishlist_items’, $ids ); } /** * Persist the wishlist and return the cleaned array. */ function exp_save_wishlist( $ids ) { $ids = array_values( array_unique( array_filter( array_map( ‘absint’, (array) $ids ) ) ) ); $ids = array_slice( $ids, 0, 100 ); // Hard cap, protects the cookie size. if ( is_user_logged_in() ) { update_user_meta( get_current_user_id(), EXP_WISHLIST_META, $ids ); } else { $value = wp_json_encode( $ids ); setcookie( EXP_WISHLIST_COOKIE, $value, time() + ( 90 * DAY_IN_SECONDS ), COOKIEPATH ? COOKIEPATH : ‘/’, COOKIE_DOMAIN, is_ssl(), false ); $_COOKIE[ EXP_WISHLIST_COOKIE ] = $value; } do_action( ‘exp_wishlist_saved’, $ids ); return $ids; } Why user meta and not a custom table? A wishlist is a short list of integers attached to one user. User meta is already cached by WordPress object caching, requires zero migration code, and is included in every standard WordPress backup or export. Merge the guest list at login A shopper who saves three products as a guest and then logs in should keep those products. One hook handles it: add_action( ‘wp_login’, ‘exp_wishlist_merge_on_login’, 10, 2 ); function exp_wishlist_merge_on_login( $user_login, $user ) { if ( empty( $_COOKIE[ EXP_WISHLIST_COOKIE ] ) ) { return; } $guest = json_decode( wp_unslash( $_COOKIE[ EXP_WISHLIST_COOKIE ] ), true ); if ( ! is_array( $guest ) || empty( $guest ) ) { return; } $saved = get_user_meta( $user->ID, EXP_WISHLIST_META, true ); if ( ! is_array( $saved ) ) { $saved = array(); } $merged = array_values( array_unique( array_map( ‘absint’, array_merge( $saved, $guest ) ) ) ); update_user_meta( $user->ID, EXP_WISHLIST_META, $merged ); setcookie( EXP_WISHLIST_COOKIE, ”, time() – 3600, COOKIEPATH ? COOKIEPATH : ‘/’, COOKIE_DOMAIN ); } Step 3: Output the save-for-later button WooCommerce gives you clean hooks for both the archive and the product page. The same function is reused later inside the wishlist table, which is why it accepts an optional product ID. A comparable breakdown sits on 10web.io. add_action( ‘woocommerce_after_shop_loop_item’, ‘exp_wishlist_button’, 15 ); add_action( ‘woocommerce_single_product_summary’, ‘exp_wishlist_button’, 35 ); function exp_wishlist_button( $product_id = 0 ) { if ( ! $product_id ) { global $product; if ( ! $product instanceof WC_Product ) { return; } $product_id = $product->get_id(); } $in_list = in_array( (int) $product_id, exp_get_wishlist(), true ); printf( ‘<button type=”button” class=”exp-wishlist-btn%1$s” data-product-id=”%2$d” aria-pressed=”%3$s”><span class=”exp-wishlist-icon” aria-hidden=”true”>&#9825;</span> <span class=”exp-wishlist-label”>%4$s</span></button>’, $in_list ? ‘ is-active’ : ”, (int) $product_id, $in_list ? ‘true’ : ‘false’, esc_html( $in_list ? __( ‘Saved’, ‘exp’ ) : __( ‘Save for later’, ‘exp’ ) ) ); } Hook priorities you

How to Add a Wishlist to WooCommerce Without a Plugin (Code Tutorial) Read More »

How to Add a Sticky Add to Cart Bar in WooCommerce Without a Plugin

A WooCommerce sticky add to cart bar keeps the price and the buy button permanently in view while shoppers scroll through descriptions, galleries, tabs and reviews. On mobile, where the real add to cart button disappears after two swipes, that single UI element often does more for conversions than a redesign of the whole product page. Most articles on this topic end with the same advice: install a plugin. This tutorial does the opposite. You will build the bar yourself in a child theme with about 60 lines of PHP, a small CSS file and a lightweight JavaScript scroll listener. No extra plugin, no bloated settings panel, no render-blocking assets, and full control over what the bar shows. What you are going to build A fixed bar that slides in only after the original add to cart form scrolls out of view. Product thumbnail, truncated product name, live price and one clear call to action. Variable product support: the price updates when a variation is selected, and the button switches from Choose options to Add to cart. Zero cumulative layout shift, correct behaviour inside the iPhone safe area, and 44px tap targets. Compatibility with both classic themes and block-based (FSE) product templates. Files you will create in your child theme functions.php (add the two snippets below) assets/css/sticky-atc.css assets/js/sticky-atc.js Plugin or custom code: which one should you pick? Plugins such as Sticky Cart for WooCommerce, Simple Sticky Add To Cart or the various builder add-ons are fine if you want a five minute setup. They are not fine if you care about page weight and Core Web Vitals on product pages. Here is an honest comparison. Criteria Custom code (this tutorial) Sticky add to cart plugin Extra front-end weight About 2 KB CSS + 2 KB JS, product pages only Often 20 to 150 KB, sometimes loaded site-wide Control over markup Total, you own every element Limited to the options exposed Layout shift risk None, the bar is server rendered and animated with transform Common, many inject the bar with JS after load Setup time 20 to 30 minutes 5 minutes Maintenance You maintain it, it never breaks on plugin updates Vendor dependent, can break after WooCommerce updates Cost Free Free to around 79 USD per year Rule of thumb: if your store is above 1,000 sessions a day, the custom version pays for itself in Core Web Vitals alone. Before you start An active child theme. Never edit a parent theme, your changes will be wiped on the next update. FTP, SFTP or the file manager of your host. The theme file editor works too, but a backup first is mandatory. A staging copy if the store is live. WooCommerce with jQuery available (WooCommerce still loads it on product pages, and we use it only for variation events). Step 1: Enqueue the CSS and JS on product pages only Add this to the bottom of your child theme functions.php. The conditional check means the assets never touch your home page, your blog or your checkout. /** * Load sticky add to cart assets on single product pages only. */ add_action( ‘wp_enqueue_scripts’, ‘exp_sticky_atc_assets’ ); function exp_sticky_atc_assets() { if ( ! function_exists( ‘is_product’ ) || ! is_product() ) { return; } wp_enqueue_style( ‘exp-sticky-atc’, get_stylesheet_directory_uri() . ‘/assets/css/sticky-atc.css’, array(), ‘1.0.0’ ); wp_enqueue_script( ‘exp-sticky-atc’, get_stylesheet_directory_uri() . ‘/assets/js/sticky-atc.js’, array( ‘jquery’ ), ‘1.0.0’, true ); } Step 2: Output the bar with a hook Many tutorials hook into woocommerce_after_single_product. That hook does not fire on block-based product templates, which more and more stores now use. Hooking wp_footer with an is_product() check works everywhere, classic or FSE, and it keeps the bar at the end of the DOM where a fixed element belongs. /** * Render the sticky add to cart bar in the footer of single product pages. */ add_action( ‘wp_footer’, ‘exp_sticky_atc_bar’, 20 ); function exp_sticky_atc_bar() { if ( ! function_exists( ‘is_product’ ) || ! is_product() ) { return; } global $product; if ( ! is_a( $product, ‘WC_Product’ ) ) { $product = wc_get_product( get_the_ID() ); } // Skip products nobody can buy from the bar. if ( ! $product || ! $product->is_purchasable() || ! $product->is_in_stock() ) { return; } $is_variable = $product->is_type( ‘variable’ ); $add_text = $product->single_add_to_cart_text(); $options_text = __( ‘Choose options’, ‘child-theme’ ); $price_html = $product->get_price_html(); $image = $product->get_image( ‘woocommerce_gallery_thumbnail’, array( ‘loading’ => ‘eager’, ‘width’ => 48, ‘height’ => 48, ‘alt’ => ”, ) ); ?> <div id=”exp-sticky-atc” class=”exp-sticky-atc” aria-hidden=”true” data-add-text=”<?php echo esc_attr( $add_text ); ?>” data-options-text=”<?php echo esc_attr( $options_text ); ?>” data-default-price=”<?php echo esc_attr( $price_html ); ?>”> <div class=”exp-sticky-atc__inner”> <div class=”exp-sticky-atc__media” aria-hidden=”true”> <?php echo $image; // phpcs:ignore WordPress.Security.EscapeOutput ?> </div> <div class=”exp-sticky-atc__info”> <span class=”exp-sticky-atc__title”><?php echo esc_html( $product->get_name() ); ?></span> <span class=”exp-sticky-atc__price”><?php echo wp_kses_post( $price_html ); ?></span> </div> <button type=”button” class=”button exp-sticky-atc__button” data-product-id=”<?php echo esc_attr( $product->get_id() ); ?>” <?php echo $is_variable ? ‘data-needs-options=”1″‘ : ”; ?>> <?php echo esc_html( $is_variable ? $options_text : $add_text ); ?> </button> </div> </div> <?php } Because the bar is printed by PHP, it exists in the HTML the browser receives. That is the first half of the no-layout-shift strategy: nothing is injected after load. Step 3: The CSS (mobile-first, safe area aware) Create assets/css/sticky-atc.css in your child theme and paste the following. :root { –exp-atc-height: 64px; –exp-atc-offset: 0px; /* raise the bar if you have a chat widget */ } /* Reserve the space at CSS parse time so the footer is never hidden and nothing moves after load. */ @media (max-width: 991px) { body.single-product { padding-bottom: calc(var(–exp-atc-height) + env(safe-area-inset-bottom, 0px)); } } .exp-sticky-atc { position: fixed; left: 0; right: 0; bottom: var(–exp-atc-offset); z-index: 9990; background: #fff; border-top: 1px solid #e5e7eb; box-shadow: 0 -2px 14px rgba(0, 0, 0, .08); padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); transform: translateY(110%); transition: transform .22s ease; will-change: transform; pointer-events: none; contain: layout paint; } .exp-sticky-atc.is-visible { transform: translateY(0); pointer-events: auto; } .exp-sticky-atc__inner { display: flex; align-items: center; gap: 10px; max-width: 1200px; margin: 0 auto; min-height: 48px; } .exp-sticky-atc__media img { display: block; width: 48px; height: 48px; object-fit: cover; border-radius: 6px; } .exp-sticky-atc__info

How to Add a Sticky Add to Cart Bar in WooCommerce Without a Plugin Read More »

How to Design a Newsletter Signup Form That Converts (Placement, Copy, and CSS)

Most articles about newsletter signup form design stop at inspiration galleries. This one goes further: you get the placement data, the field rules, the copy patterns, and the actual markup, CSS and Express.js endpoint you need to ship a form that converts today. The short answer A high converting newsletter signup form follows six rules: One field (email) unless personalisation genuinely drives revenue. Placed where attention already exists: mid-article inline, end of post, and exit intent beat the footer every time. A value headline, not a label. Replace “Subscribe to our newsletter” with what the reader receives. A specific CTA button: “Send me the weekly tips” outperforms “Submit”. Visible states: focus, error, loading and success, all announced to screen readers. Trust microcopy: frequency, format and a one click unsubscribe promise. Step 1: Choose the right placement Placement affects opt-in rate more than colours, borders or illustrations. The same form can convert ten times better simply by moving it. Here is how the common placements compare in practice. Placement Typical opt-in rate Intrusiveness Best for Inline, mid or end of article 1% to 3% Low Blogs, docs, tutorials Exit intent modal (desktop) 2% to 5% High High traffic pages, ecommerce Two step popup (click a link, then form) 3% to 8% of clickers Low Lead magnets, checklists, templates Sticky bar (top or bottom) 0.5% to 1.5% Medium Site wide, always on offer Sidebar widget 0.3% to 1% Low Desktop heavy audiences Footer 0.1% to 0.5% None Baseline coverage, brand sites Dedicated landing page 10% to 25% None Paid traffic, social bio links Treat those numbers as ranges, not promises. They depend on traffic quality, offer strength and industry. What holds true everywhere is the ordering: intent driven placements beat passive ones. The placement stack that works on most sites Always on: a footer form (cheap, zero friction, catches people who go looking). Primary driver: an inline form after the third or fourth section of every article, plus one at the end. Safety net: an exit intent modal on desktop only, capped at once per 30 days per visitor. Campaign specific: a two step popup attached to a lead magnet link. Never stack a sticky bar, a modal and a slide-in on the same page. Competing prompts kill trust and hurt Core Web Vitals through layout shift. Mobile rules No full screen interstitials on entry. Google treats intrusive interstitials as a ranking negative on mobile. Exit intent does not exist on touch devices. Use scroll depth (60% to 70%) or a time delay instead. Keep the input at least 44px tall and set inputmode=”email” so the keyboard shows the @ key. Step 2: Decide how many fields Every extra field costs conversions. The trade-off is data you can use for segmentation. Form Relative conversion When to use it Email only Baseline (best) Default for content newsletters Email + first name Roughly 5% to 10% lower Only if you actually personalise subject lines Email + topic checkboxes Roughly 10% to 20% lower Multi-product sites where relevance lifts engagement Email + company + role 30%+ lower B2B lead gen, never a plain newsletter Better approach: ask for the email first, then collect the rest on the confirmation page or in the welcome email. The subscriber is already committed, so completion rates are high and your form stays a single input. Step 3: Write copy that earns the address Design gets attention. Copy gets the submit. Three blocks matter: headline, button, reassurance. Headline formulas Outcome + cadence: “One practical Node.js tip, every Friday.” Audience + benefit: “For backend developers who ship: performance patterns explained in 3 minutes.” Curiosity + proof: “The bugs we fixed this week, read by 12,480 developers.” Exclusive access: “Release notes and breaking changes before they hit the docs.” Avoid “Sign up for our newsletter” as a headline. It describes the mechanism, not the reward. Button copy Weak Stronger Why Submit Send me the weekly tips First person, restates the value Subscribe Join 12,480 developers Adds social proof at the click point Sign up Get the first issue Immediate, concrete reward Reassurance microcopy Put one short line directly under the button. Keep it factual: “Two emails a month. Unsubscribe in one click.” “We never share your address. See our privacy policy.” “Double opt-in: you will get a confirmation email first.” The word “spam” can backfire, since it plants the idea. Describe the frequency instead. Newsletter Signup Form Template is a useful companion to this. Step 4: Build the form (HTML) Semantic, accessible markup with a honeypot field for bots and explicit state containers for errors and success. <form class=”nl-form” id=”nl-form” action=”/api/subscribe” method=”post” novalidate> <h2 class=”nl-form__title”>One practical Node.js tip, every Friday</h2> <p class=”nl-form__sub”>Two minute read, code first, no fluff. Join 12,480 developers.</p> <div class=”nl-field”> <label class=”nl-label” for=”nl-email”>Email address</label> <input class=”nl-input” id=”nl-email” name=”email” type=”email” inputmode=”email” autocomplete=”email” placeholder=”[email protected]” required aria-describedby=”nl-error nl-note”> <p class=”nl-error” id=”nl-error” hidden>Please enter a valid email address.</p> </div> <!– Honeypot: hidden from humans, filled by bots –> <div class=”nl-hp”> <label for=”nl-company”>Company</label> <input id=”nl-company” name=”company” type=”text” tabindex=”-1″ autocomplete=”off”> </div> <button class=”nl-button” type=”submit”> <span class=”nl-button__label”>Send me the weekly tips</span> <span class=”nl-spinner” aria-hidden=”true”></span> </button> <p class=”nl-note” id=”nl-note”>Four emails a month. Unsubscribe in one click.</p> <p class=”nl-success” role=”status” hidden>Almost done. Check your inbox and confirm your subscription.</p> </form> Accessibility checklist Always ship a real <label>. A placeholder is not a label and disappears on typing. Link the error message with aria-describedby and toggle aria-invalid=”true”. Give the success message role=”status” so screen readers announce it without stealing focus. Keep contrast at 4.5:1 for text and 3:1 for the input border. Do not hide the honeypot with display:none only; use off-screen positioning so it stays plausible to bots but invisible to users. Step 5: Style it (responsive CSS with validation states) This CSS uses custom properties so you can theme the form in one place, switches to a single row layout on wider screens, and respects reduced motion preferences. .nl-form { –nl-bg: #ffffff; –nl-fg: #111827; –nl-muted: #6b7280; –nl-border: #d1d5db; –nl-accent: #2563eb; –nl-error: #dc2626; –nl-success: #047857; –nl-radius: 10px;

How to Design a Newsletter Signup Form That Converts (Placement, Copy, and CSS) Read More »

How to Create a CSS-Only Accordion Without JavaScript (Details and Summary Tags)

A CSS only accordion is one of the easiest performance wins available on a modern site. No JavaScript bundle, no hydration delay, no ARIA wiring to maintain, and keyboard support that works the second the HTML is parsed. The native <details> and <summary> elements do the heavy lifting, and modern CSS now handles the part that used to require scripting: a smooth open and close animation from zero to auto height. This tutorial gives you the full recipe, plus two copy-ready blocks you can paste straight into a page today: an FAQ accordion and a product specs accordion. We also cover the parts most tutorials skip, such as what actually happens in browsers that do not support the newest animation properties, and when the old checkbox hack is still the right call. Quick answer: what is a CSS-only accordion? A CSS only accordion is an expand and collapse UI built with HTML and CSS alone, with no JavaScript event listeners. There are two ways to build one: The native way (recommended): a series of <details> elements, each with a <summary> header. The browser handles open and close state, focus, keyboard, and screen reader semantics. The checkbox or radio hack (legacy): hidden <input> elements paired with <label> headers and the :checked selector. It animates well but it lies to assistive technology, because a checkbox is not a disclosure widget. Unless you have a very specific reason, use <details>. Here is how the two compare. Criteria details / summary Checkbox hack Keyboard support Built in (Tab, Enter, Space) Needs tabindex tricks Screen reader semantics Announced as an expandable group Announced as a checkbox Find in page (Ctrl+F) Opens the matching panel Fails on hidden content One panel open at a time Yes, with the name attribute Yes, with radio inputs Close animation Yes in modern browsers Yes everywhere Markup weight Minimal Extra inputs and labels Step 1: the markup Start with clean, semantic HTML. Each accordion item is one <details> element, the header is the <summary>, and everything after it is the panel. <div class=”accordion”> <details class=”accordion__item” open> <summary class=”accordion__header”>What is included in the free plan?</summary> <div class=”accordion__panel”> <p>Unlimited projects, 2 GB of storage and community support.</p> </div> </details> <details class=”accordion__item”> <summary class=”accordion__header”>Can I cancel at any time?</summary> <div class=”accordion__panel”> <p>Yes. Cancel in one click from your dashboard, no phone call needed.</p> </div> </details> <details class=”accordion__item”> <summary class=”accordion__header”>Do you offer invoices for companies?</summary> <div class=”accordion__panel”> <p>Every payment generates a PDF invoice with your VAT number.</p> </div> </details> </div> Three rules to remember: The <summary> must be the first child of <details>, otherwise the browser generates an implicit one. Wrap the panel content in a single element. That wrapper is what you will pad and animate. Add open to the item you want expanded on load. Opening the first item is good for engagement, but leave all closed if the list is long. Step 2: remove the default marker Browsers draw a small triangle before the summary text. Remove it so you can design your own icon. .accordion__header { list-style: none; /* Chrome, Firefox, Safari 18+ */ } .accordion__header::-webkit-details-marker { display: none; /* older Safari */ } If you like the native triangle and just want it recoloured or resized, keep it and style the ::marker pseudo element instead: .accordion__header::marker { color: #2563eb; font-size: 1.1em; } Step 3: base styles .accordion { –acc-border: #e5e7eb; –acc-accent: #2563eb; –acc-hover: #f8fafc; max-width: 44rem; border: 1px solid var(–acc-border); border-radius: 12px; overflow: hidden; background: #fff; font-family: system-ui, -apple-system, “Segoe UI”, sans-serif; } .accordion__item + .accordion__item { border-top: 1px solid var(–acc-border); } .accordion__header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; font-weight: 600; line-height: 1.4; cursor: pointer; user-select: none; list-style: none; } .accordion__header:hover { background: var(–acc-hover); } .accordion__header:focus-visible { outline: 3px solid var(–acc-accent); outline-offset: -3px; } .accordion__panel { padding: 0 1.25rem 1.25rem; color: #475569; line-height: 1.65; } Note the :focus-visible rule. Never delete the focus ring on a summary, it is the only visual cue a keyboard user gets. Step 4: a custom marker that rotates A chevron built from two borders costs zero extra requests and inherits the text colour. .accordion__header::after { content: “”; flex: none; width: 0.6rem; height: 0.6rem; margin-inline-end: 0.2rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform 220ms ease; } .accordion__item[open] > .accordion__header::after { transform: rotate(-135deg) translateY(-2px); } Prefer a plus and minus sign? Swap the pseudo element content: .accordion__header::after { content: “+”; font-size: 1.4rem; line-height: 1; border: 0; transform: none; } .accordion__item[open] > .accordion__header::after { content: “\2212″; } Step 5: make it an exclusive accordion (one panel at a time) This used to be the number one reason people reached for JavaScript. It is now a single HTML attribute. Give every <details> in the group the same name value and the browser closes the others automatically. <details class=”accordion__item” name=”faq”> … </details> <details class=”accordion__item” name=”faq”> … </details> <details class=”accordion__item” name=”faq”> … </details> Two details worth knowing: Only one item in a named group may carry the open attribute in the source, otherwise the last one wins. Grouped items do not have to be siblings, although keeping them together is far easier to reason about. Leave name off if you want visitors to open several sections side by side, which is usually better for comparison-style content such as product specs. Step 6: animate the open state with pure CSS Animating from height 0 to auto was impossible for years. Three modern features solve it together: interpolate-size: allow-keywords lets the browser interpolate to and from auto. ::details-content targets the hidden content wrapper the browser creates inside <details>. transition-behavior: allow-discrete keeps the content visible while the closing transition plays. :root { interpolate-size: allow-keywords; } .accordion__item::details-content { block-size: 0; overflow: hidden; opacity: 0; transition: block-size 280ms ease, opacity 220ms ease, content-visibility 280ms allow-discrete; } .accordion__item[open]::details-content { block-size: auto; opacity: 1; } @media (prefers-reduced-motion: reduce) { .accordion__item::details-content, .accordion__header::after { transition: none; } } That is the whole animation. No scrollHeight measurement, no requestAnimationFrame, no layout thrashing. What happens in browsers

How to Create a CSS-Only Accordion Without JavaScript (Details and Summary Tags) Read More »

How to Design a Website for a Dentist: Pages, Booking Flow, and Trust Signals

Most dental practice websites look fine and convert badly. They open with a stock photo of a smiling model, bury the phone number three scrolls down, and hide appointment booking behind a contact form that nobody answers until Monday. Good dentist website design is not an art project. It is a booking machine. Someone with a cracked molar at 11pm is not browsing your site for inspiration. They want to know: do you treat this, do you take my insurance, are you nearby, are you any good, and how fast can I get in? This guide breaks down the exact page structure a dental practice needs, the booking flow that removes friction, and the trust elements that actually move visitors into your chair. Layout examples are written mobile-first, because that is where the majority of dental searches happen. Start With the Only Metric That Matters: Booked Appointments Before you pick a template or a color palette, define what a “win” looks like on your site. For a dental practice there are only four conversion events worth tracking: Online appointment booked (highest value, fully self-service) Phone call from a mobile device (still the number one action for urgent care) New patient form started (pre-visit paperwork completed online) Directions tapped (strong intent, usually a walk-in or same-day call) Every page you build should push toward one of those four. If a page does not serve a conversion event, an SEO purpose, or a trust purpose, it should not exist. Rule of thumb: a dental site of 15 well-built pages outperforms a site of 60 thin ones, every single time. The Page Structure a Dental Practice Website Actually Needs Here is the core sitemap. Build these first, then expand. Page Primary job Main call to action Homepage Qualify the visitor in 5 seconds: location, services, availability Book online / Call now Service pages (one per treatment) Rank for treatment searches and answer cost, pain, duration Book a consultation Meet the team / About Turn an anonymous clinic into real humans Book with a specific dentist New patients Explain the first visit step by step, reduce anxiety Complete forms online Insurance & financing Remove the number one objection: cost Verify my coverage Book an appointment Real-time scheduling, zero friction Confirm booking Smile gallery (before/after) Prove clinical quality visually Book a cosmetic consult Reviews & testimonials Third-party validation in one place Book online Contact & location(s) Address, map, parking, hours, emergency line Get directions / Call Emergency dentist page Capture urgent, high-intent searches Call now (tap-to-call) Blog / patient education Capture informational searches, feed internal links Related service page Privacy, accessibility, HIPAA notice Legal compliance and quiet credibility None One Service, One Page Do not stuff implants, veneers, Invisalign, root canals, and pediatric care onto a single “Services” page. Each treatment has different search intent, different objections, and a different price point. Build a dedicated page for every service you genuinely want more of: General and preventive: cleanings, exams, fillings, sealants Restorative: crowns, bridges, dentures, root canal therapy Cosmetic: veneers, teeth whitening, bonding, smile makeovers Implants: single tooth, multiple, full arch Orthodontics: clear aligners, braces Specialty: pediatric dentistry, sedation dentistry, periodontal treatment, wisdom teeth Emergency dental care Add a short parent “Services” hub page that links to all of them. That hub is for navigation and internal linking, not for ranking. The Service Page Template That Converts Use the same skeleton for every treatment page so patients learn the pattern: H1 with treatment + city (example: Dental Implants in Portland) One-sentence summary of what the treatment solves Booking button + phone number immediately below the intro Who it is for (symptoms and situations in a bullet list) How it works, step by step, with an honest timeline Cost range and financing, even if it is a range Pain and recovery, answered plainly Before and after photos from your own patients 2 to 3 reviews specific to that treatment The dentist who performs it, with photo and credentials FAQ block (5 to 8 questions, marked up with FAQ schema) Final booking call to action Homepage Layout: What Goes Above the Fold on Mobile On a phone you have roughly 650 pixels of height before the first scroll. Spend them like this: Position Element Why Sticky top bar Logo + tap-to-call icon + menu Urgent visitors convert in one tap Hero headline Practice type + city + differentiator Confirms they are in the right place Subline Availability signal (“Same-week appointments, evenings available”) Speed is the top decision factor Primary button Book Online (full width, 48px+ tall) Thumb-friendly, unmissable Secondary button Call (tel: link) For patients who prefer voice Trust strip Star rating + review count + “Most insurance accepted” Kills the two biggest objections early Below the fold, in order: service tiles (icon + name, 2 columns on mobile), a real photo of your actual office, the team row, insurance logos, three reviews, a map with hours, and a closing booking block. That is it. A homepage does not need fourteen sections. Replace the stock photo Patients can spot a stock model instantly, and it quietly signals “we cut corners.” One half-day photo shoot of your real team, real operatories, and real reception area outperforms every premium stock library. Use those images everywhere: homepage hero, team page, service pages, Google Business Profile. The Booking Flow: Where Most Dental Sites Lose Patients A “Request an Appointment” form that emails the front desk is not online booking. It is a lead form with an unknown response time, and it leaks patients overnight and on weekends, which is exactly when people search for a dentist. Three Levels of Booking, Ranked Level What it is Patient friction Verdict 1. Request form Name, email, “preferred time” High, no confirmation Backup only 2. Calendar with fixed slots Bookable blocks, manually synced Medium, risk of double booking Acceptable for small practices 3. Real-time PMS integration Live availability from your practice software Low, instant confirmation Target this The Four-Step Flow That Minimizes Drop-Off Reason

How to Design a Website for a Dentist: Pages, Booking Flow, and Trust Signals Read More »

How to Add a Cookie Consent Banner to a Website Without a Plugin (HTML, CSS, JS)

If you search for a cookie consent banner HTML snippet, you mostly find hosted consent platforms that inject 80 to 150 KB of JavaScript, add extra DNS lookups and sometimes break your Largest Contentful Paint. For a lot of sites, that is overkill. A compliant banner is basically three things: some markup, a stored decision, and a script loader that only fires after the user says yes. This tutorial shows how to build exactly that: a self-hosted cookie consent banner in plain HTML, CSS and vanilla JavaScript, around 2 KB, that stores the user choice in localStorage and conditionally loads analytics scripts only after consent. No dependencies, no external requests, full control over the markup and the styling. What a cookie consent banner actually has to do Before writing code, it helps to know which behaviours are non negotiable under the GDPR and the ePrivacy Directive. Most banners fail not because of their design, but because they fire tracking scripts before the click. There is a practical rundown of it online. Requirement What it means in code Prior consent No analytics, ads or social scripts in the initial HTML. They are injected after the accept click. Freely given A reject option with the same visual weight as accept, on the first layer. Specific and informed Named categories plus a link to your cookie or privacy policy. No pre-ticked boxes Optional categories default to false in your state object. Withdrawable A permanent Cookie settings link in the footer that reopens the banner. Provable Store a timestamp and a version with the decision, and optionally log it server side. Strictly necessary cookies, such as a login session or a CSRF token, do not need consent. That is why the banner below never blocks your own essential functionality. What we are building A fixed bottom banner with Accept all, Reject non-essential and an optional Customize step The decision stored in localStorage as JSON, with a version and a timestamp Google Analytics 4 (or any other tag) injected only when analytics is granted A reusable cc:consent DOM event so other scripts can react Zero external requests, zero layout shift, no render-blocking JavaScript Step 1: the HTML markup Put this just before the closing </body> tag. It is a dialog role, hidden by default, so nothing flashes if consent was already given. cookiesaur.com published something useful on the subject. <div id=’cc-banner’ class=’cc-banner’ role=’dialog’ aria-live=’polite’ aria-labelledby=’cc-title’ aria-describedby=’cc-desc’ hidden> <div class=’cc-inner’> <div class=’cc-text’> <h2 id=’cc-title’ class=’cc-title’>We use cookies</h2> <p id=’cc-desc’ class=’cc-desc’> Essential cookies keep this site running. With your consent we also use analytics cookies to measure how pages are used. You can change your mind at any time. <a href=’/privacy-policy/’ class=’cc-link’>Read our privacy policy</a> </p> </div> <div class=’cc-actions’> <button type=’button’ class=’cc-btn cc-btn-ghost’ data-cc=’reject’>Reject non-essential</button> <button type=’button’ class=’cc-btn cc-btn-solid’ data-cc=’accept’>Accept all</button> </div> </div> </div> Two details that matter: The buttons are real <button> elements, not links or divs, so keyboard and screen reader users get them for free. Reject and accept share the same cc-btn base class. Only the fill changes, which keeps the two choices equally prominent. Step 2: the CSS Inline this in the <head> or add it to your main stylesheet. Because the banner is position: fixed, it never pushes content around, so it cannot hurt your Cumulative Layout Shift score. The piece Cookie Banner: Legal Requirement or Best Practice makes a good next read. .cc-banner{position:fixed;inset:auto 0 0 0;z-index:9999;background:#111;color:#f5f5f5; font:16px/1.5 system-ui,-apple-system,Segoe UI,Roboto,sans-serif; box-shadow:0 -2px 16px rgba(0,0,0,.35)} .cc-banner[hidden]{display:none} .cc-inner{max-width:1100px;margin:0 auto;padding:18px 20px;display:flex;gap:20px; align-items:center;flex-wrap:wrap} .cc-title{margin:0 0 4px;font-size:17px;font-weight:700} .cc-desc{margin:0;font-size:14px;color:#d8d8d8} .cc-link{color:#7fd1ff;text-decoration:underline} .cc-actions{display:flex;gap:10px;margin-left:auto;flex-wrap:wrap} .cc-btn{cursor:pointer;border-radius:6px;padding:11px 18px;font-size:14px;font-weight:600; border:1px solid #f5f5f5;background:transparent;color:#f5f5f5} .cc-btn-solid{background:#f5f5f5;color:#111} .cc-btn:focus-visible{outline:3px solid #7fd1ff;outline-offset:2px} @media (max-width:640px){ .cc-inner{padding:16px;gap:14px} .cc-actions{margin-left:0;width:100%} .cc-btn{flex:1 1 auto} } Step 3: the JavaScript with localStorage This is the core of the whole cookie consent banner. The state object is intentionally boring: a version, a timestamp and a categories map. Keeping the version lets you re-ask for consent when you add a new vendor. (function () { var KEY = ‘cc_consent_v1’; var TTL_DAYS = 180; // re-ask after 6 months var GA_ID = ‘G-XXXXXXXXXX’; // replace with your own var banner = document.getElementById(‘cc-banner’); function readConsent() { try { var raw = window.localStorage.getItem(KEY); if (!raw) return null; var data = JSON.parse(raw); if (!data || !data.ts || !data.categories) return null; var ageDays = (Date.now() – data.ts) / 86400000; if (ageDays > TTL_DAYS) return null; return data; } catch (e) { return null; } } function saveConsent(categories) { var data = { v: 1, ts: Date.now(), categories: categories }; try { window.localStorage.setItem(KEY, JSON.stringify(data)); } catch (e) {} return data; } function loadAnalytics() { if (window.__ccAnalytics) return; window.__ccAnalytics = true; var s = document.createElement(‘script’); s.async = true; s.src = ‘https://www.googletagmanager.com/gtag/js?id=’ + GA_ID; document.head.appendChild(s); window.dataLayer = window.dataLayer || []; window.gtag = function () { window.dataLayer.push(arguments); }; window.gtag(‘js’, new Date()); window.gtag(‘config’, GA_ID, { anonymize_ip: true }); } function applyConsent(data) { if (data.categories.analytics) loadAnalytics(); document.dispatchEvent(new CustomEvent(‘cc:consent’, { detail: data })); } function hideBanner() { banner.hidden = true; } function showBanner() { banner.hidden = false; var first = banner.querySelector(‘[data-cc=\”accept\”]’); if (first) first.focus({ preventScroll: true }); } function decide(categories) { applyConsent(saveConsent(categories)); hideBanner(); } banner.addEventListener(‘click’, function (e) { var action = e.target.getAttribute && e.target.getAttribute(‘data-cc’); if (action === ‘accept’) decide({ essential: true, analytics: true }); if (action === ‘reject’) decide({ essential: true, analytics: false }); }); // Footer link: <button type=’button’ data-cc-open>Cookie settings</button> document.addEventListener(‘click’, function (e) { var opener = e.target.closest && e.target.closest(‘[data-cc-open]’); if (opener) { e.preventDefault(); showBanner(); } }); var stored = readConsent(); if (stored) { applyConsent(stored); } else { showBanner(); } })(); Load it with <script src=’/js/cookie-consent.js’ defer></script>. Because it is deferred and dependency free, it costs you nothing on first paint. Why localStorage instead of a cookie? Storage Pros Cons localStorage No bytes sent on every request, easy JSON, simple to inspect and clear Not readable server side, per origin only Cookie Readable in your backend, works across subdomains Adds weight to every HTTP request, needs escaping and expiry handling Use localStorage when all your tags are client side, which is the common case. Switch to a first-party cookie if your server needs to know the decision

How to Add a Cookie Consent Banner to a Website Without a Plugin (HTML, CSS, JS) Read More »

How to Design a Testimonials Section That Builds Trust (Layouts and CSS Examples)

Most testimonial sections fail for the same reason: they look like decoration instead of evidence. A row of anonymous five-star quotes with stock photos gets skimmed and forgotten. A single sentence from a named buyer describing a measurable outcome can carry an entire landing page. This guide is not another gallery of screenshots. It covers the testimonial section design decisions that actually move conversion rates: which layout to use for which page, what makes a quote credible, and the CSS you can paste into your project today. Every snippet below is dependency-free, responsive, and accessible. What is a testimonial section (and what it is really for) A testimonial section is a block on a web page that displays quotes, ratings or short stories from real customers, usually with the person’s name, photo, role and company. Structurally it is a set of <blockquote> elements with attribution. Its job is narrow and specific: to remove a doubt at the exact moment the visitor feels it. That is why placement matters as much as visual design. A testimonial about onboarding speed belongs next to the pricing table, not buried in a carousel at the bottom of the homepage. The credibility checklist: what makes a testimonial believable Before you touch CSS, audit your content. A beautiful section filled with weak quotes converts worse than an ugly section filled with strong ones. Score each testimonial out of 7: Signal Weak version Strong version Full name Sarah M. Sarah Mendel Real photo Stock portrait or initials LinkedIn-style headshot Job title + company Happy customer Head of Engineering, Northline Logistics Specific result Great service, highly recommend Cut our API response time from 800ms to 120ms in three weeks Objection handled Nice team to work with I was worried about migration downtime. We shipped with zero downtime. Verifiable source No link Link to G2 review, LinkedIn profile or case study Length 200+ words of praise 20 to 45 words, one idea Rule of thumb: if a quote could have been written about any company in your industry, it is not a testimonial, it is filler. Delete it. One practical trick: bold the result inside the quote. Readers skim testimonials, so highlighting the number or outcome makes the proof survive a two-second glance. Where to place testimonials: homepage, service page, pricing page Placement is the highest-leverage decision in testimonial section design. Use the doubt each page creates as your map. Page Placement Best layout What the quote must prove Homepage Logo strip directly under the hero, full grid after the second value block Logo strip + 3-card grid Serious companies trust us Service / feature page Inline after each feature explanation Single pull quote (no card) This specific feature delivered a specific result Pricing page Immediately below the plan table, above the FAQ 2 quote cards focused on ROI The price was worth it and there were no surprises Checkout / signup Sidebar next to the form One compact quote + rating Signing up is safe and quick Blog post Mid-article, near the CTA Inline pull quote We practice what we write about Two placement mistakes to avoid: putting the only testimonial section in the footer area where scroll depth drops below 30 percent, and repeating the exact same three quotes on every page so returning visitors stop seeing them. Shared base CSS (paste this first) All layouts below share the same card and attribution styles, so define them once. :root{ –t-bg:#ffffff; –t-border:#e5e7eb; –t-text:#1f2937; –t-muted:#6b7280; –t-accent:#0f766e; –t-radius:14px; } .t-section{padding:72px 20px;max-width:1160px;margin-inline:auto} .t-head{max-width:640px;margin:0 auto 40px;text-align:center} .t-head h2{font-size:clamp(1.5rem,3vw,2.125rem);line-height:1.2;margin:0 0 12px} .t-head p{color:var(–t-muted);margin:0} .t-card{ background:var(–t-bg); border:1px solid var(–t-border); border-radius:var(–t-radius); padding:24px; display:flex; flex-direction:column; gap:18px; box-shadow:0 1px 2px rgba(16,24,40,.06); } .t-card blockquote{margin:0;font-size:1.0625rem;line-height:1.65;color:var(–t-text)} .t-card blockquote strong{color:var(–t-accent)} .t-person{display:flex;align-items:center;gap:12px;margin-top:auto} .t-person img{width:44px;height:44px;border-radius:50%;object-fit:cover;flex:0 0 auto} .t-name{font-weight:600;font-size:.9375rem;line-height:1.3} .t-role{color:var(–t-muted);font-size:.8125rem;line-height:1.3} .t-stars{color:#f59e0b;font-size:.875rem;letter-spacing:2px} And the semantic markup for a single card, reused everywhere: <figure class=’t-card’> <div class=’t-stars’ aria-label=’Rated 5 out of 5′>★★★★★</div> <blockquote>We migrated 14 services in one sprint and <strong>cut hosting costs by 38%</strong>. The rollback plan alone was worth it.</blockquote> <figcaption class=’t-person’> <img src=’/img/sarah-mendel.jpg’ width=’44’ height=’44’ alt=’Sarah Mendel’ loading=’lazy’> <div> <div class=’t-name’>Sarah Mendel</div> <div class=’t-role’>Head of Engineering, Northline Logistics</div> </div> </figcaption> </figure> Use <figure> + <figcaption> rather than a bare <div>. It gives screen readers the relationship between the quote and its author, and it keeps the markup meaningful without extra ARIA. Layout 1: the responsive grid (the safe default) Best for homepages and dedicated testimonial pages. It shows volume of proof at a glance and needs zero JavaScript. .t-grid{ display:grid; gap:24px; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); align-items:stretch; } /* optional: make the first card the hero quote */ @media (min-width:900px){ .t-grid .t-card:first-child{grid-column:span 2} .t-grid .t-card:first-child blockquote{font-size:1.25rem} } Why auto-fit with minmax: the grid reflows from 3 columns to 2 to 1 without a single media query, and cards never get narrower than a readable 280px. Design decisions that matter here Three or six cards, not four. Four cards create an awkward 2+2 on tablet and a lonely orphan on desktop. Equal height, unequal content. margin-top:auto on the attribution row pins names to the bottom so the grid reads as a tidy baseline. Trim quotes to a similar length. Aim for 25 to 45 words each. Wildly different lengths make the section feel unedited. Layout 2: masonry columns for uneven quote lengths If you have great quotes of very different lengths and refuse to trim them, use CSS columns instead of grid. It looks editorial and avoids huge empty gaps. .t-masonry{columns:3 300px;column-gap:24px} .t-masonry .t-card{break-inside:avoid;margin:0 0 24px} @media (max-width:640px){.t-masonry{columns:1}} Trade-off to know: CSS columns flow content top-to-bottom per column, so the DOM order does not match visual reading order left-to-right. Put your strongest testimonial first anyway, since it will land at the top of column one. Layout 3: scroll-snap slider (no JavaScript) Sliders are right when you have 8+ testimonials and limited vertical space, such as a pricing page or a mobile-first landing page. Build it with native scroll snapping instead of a carousel library. Testimonial Graphic Templates tackles the same question from another angle. .t-slider{ display:flex; gap:20px; overflow-x:auto; scroll-snap-type:x mandatory; scroll-behavior:smooth; padding:4px 4px 20px; -webkit-overflow-scrolling:touch; scrollbar-width:thin;

How to Design a Testimonials Section That Builds Trust (Layouts and CSS Examples) Read More »

How to Add a Custom Loading Animation to a Website With CSS (No JavaScript Library)

Almost every tutorial about a CSS loading animation stops at the same place: here is a spinning circle, copy the keyframes, done. What they rarely tell you is that a badly implemented loading screen can make your site feel slower, push your Largest Contentful Paint later, and create layout shift the moment the content finally appears. This tutorial takes the opposite approach. You will build a lightweight preloader and a skeleton screen with pure CSS, hide them with roughly ten lines of vanilla JavaScript, and apply the rules that keep the animation off the browser’s main thread. No spinner library, no animation framework, no extra kilobytes. This discussion raises a few points we skipped. Quick answer: the minimum viable CSS loading animation If you only need the code, here it is. One element, one keyframe, no dependencies: <div class=”spinner” role=”status” aria-label=”Loading”></div> <style> .spinner { width: 48px; height: 48px; border-radius: 50%; border: 4px solid rgba(0, 0, 0, 0.12); border-top-color: #0b63f6; animation: spinner-rotate 0.8s linear infinite; } @keyframes spinner-rotate { to { transform: rotate(360deg); } } </style> That is the whole spinner. The rest of this article is about the part that actually matters: where you put it, when you remove it, and how to keep it from damaging your performance metrics. First decide: do you even need a loading screen? A full-screen preloader hides your content on purpose. On a fast connection, that means you are deliberately delaying the moment the user sees something useful. Use this table as a decision guide before you write a single line of CSS. Expected wait What to show Why Under 100 ms Nothing The action feels instant. An indicator that flashes for 80 ms only creates visual noise. 100 ms to 1 s Subtle inline state (button spinner, dimmed area) Confirms the click was registered without blocking the page. 1 s to 10 s Skeleton screen or spinner Users need proof that something is happening. Skeletons win for content, spinners for actions. Over 10 s Determinate progress bar with text An infinite spinner for 12 seconds reads as “broken”, not “loading”. Rule of thumb: content pages should almost never use a full-screen preloader. Dashboards, editors, canvas apps and anything that needs to boot before it is usable are the legitimate use cases. Part 1: a full-screen preloader in pure CSS Step 1: the markup Put the overlay as the first element inside the body, before your app markup. It must be able to paint before anything else. <body> <div id=”preloader” class=”preloader” role=”status” aria-live=”polite”> <div class=”preloader__spinner” aria-hidden=”true”></div> <span class=”visually-hidden”>Loading page content</span> </div> <main id=”app”> <!– your real content –> </main> </body> Step 2: inline the critical CSS This is the step most tutorials skip. If your preloader styles live in an external stylesheet that arrives late, the user sees an unstyled flash of your raw HTML first. Put the overlay CSS inline in the <head>, and keep it tiny. <head> <style> .preloader { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: #ffffff; opacity: 1; transition: opacity 0.3s ease, visibility 0.3s ease; } .preloader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; } .preloader__spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid #e3e8ef; border-top-color: #0b63f6; animation: preloader-rotate 0.8s linear infinite; } @keyframes preloader-rotate { to { transform: rotate(360deg); } } .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; } @media (prefers-reduced-motion: reduce) { .preloader__spinner { animation: preloader-fade 1.4s ease-in-out infinite; } @keyframes preloader-fade { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } } } </style> </head> Notice three details: The animation only touches transform, which the browser can composite without repainting. The exit uses opacity plus visibility, not display: none, so the fade actually renders. Users who requested reduced motion get a gentle opacity pulse instead of a rotating element. Step 3: hide it with a few lines of vanilla JavaScript No library needed. Listen for the load event, add a class, then remove the node from the DOM so it never intercepts clicks. (function () { var preloader = document.getElementById(‘preloader’); if (!preloader) return; function hidePreloader() { if (preloader.classList.contains(‘is-hidden’)) return; preloader.classList.add(‘is-hidden’); document.body.classList.remove(‘is-loading’); setTimeout(function () { if (preloader.parentNode) preloader.parentNode.removeChild(preloader); }, 400); } window.addEventListener(‘load’, hidePreloader); // Safety net: never trap the user behind the overlay setTimeout(hidePreloader, 5000); })(); The safety net timeout is not optional. If a third party script hangs, a slow font never resolves, or an image 404s in a way that stalls the load event, your visitors would stare at a spinner forever. Five seconds is a reasonable ceiling. Step 4: handle the no-JavaScript case If JavaScript is blocked or fails to parse, the overlay stays on screen and your site looks dead. Add a pure CSS escape hatch that fades the preloader out on its own: .preloader { animation: preloader-selfdestruct 0s linear 8s forwards; } @keyframes preloader-selfdestruct { to { opacity: 0; visibility: hidden; } } Or, even simpler and stricter: render the overlay itself from a <noscript>-aware class that JavaScript adds to <html> at the very top of the page. If JS never runs, the overlay is never shown. There is more on it in The Progress CSS Loaders Collection. Part 2: the skeleton screen (usually the better choice) A skeleton screen shows the shape of the content before the content exists. Research on perceived performance consistently shows that people rate skeletons as faster than spinners for the same real duration, because the interface looks like it is already assembling itself. Skeleton markup <article class=”card” aria-busy=”true”> <div class=”skeleton skeleton–thumb”></div> <div class=”skeleton skeleton–line” style=”width: 80%”></div> <div class=”skeleton skeleton–line” style=”width: 95%”></div> <div class=”skeleton skeleton–line” style=”width: 60%”></div> </article> Skeleton CSS with a compositor-friendly shimmer .skeleton { position: relative; overflow: hidden; background: #e9edf2; border-radius: 6px; } .skeleton–thumb { aspect-ratio: 16 / 9; margin-bottom: 12px; } .skeleton–line { height: 0.9em; margin-bottom: 8px; } .skeleton::after { content: “”; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient( 90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.65) 50%, rgba(255, 255, 255,

How to Add a Custom Loading Animation to a Website With CSS (No JavaScript Library) Read More »

How to Design a Careers Page That Attracts Better Job Applicants

Most careers pages fail for the same three reasons: they say nothing specific, they bury the open roles, and they hand the applicant a ten-minute form. Good careers page design is not about winning a design award. It is about turning a curious visitor into a qualified applicant in under two minutes, and making sure your roles show up where candidates actually search. This guide breaks down the sections a careers page needs, the copy that goes inside each one, the layout that works on mobile, and the structured data that lets your jobs appear in Google’s job search results. It is written for small business and agency sites, so nothing here needs a six-figure recruitment marketing budget. What a careers page is actually for Before layout, get clear on the job the page has to do. A careers page has four visitors, and each one needs something different: The active applicant who already wants a job with you and just needs the list and the form. The passive candidate who found you through a job listing and is checking whether you are a real, decent company. The referral sent by a friend who works there, looking for the role their friend mentioned. The search engine, which needs machine-readable job data to index and surface your roles. A page that only serves the first visitor becomes a bare list of links. A page that only serves the second becomes a brand film with no jobs on it. You need both, in the right order. The anatomy of a high-converting careers page Section What it does Recommended length 1. Hero States who you are and links straight to open roles Headline + 1 sentence + 1 button 2. Culture blurb Gives candidates a reason to self-select in or out 80 to 150 words 3. Benefits grid Answers “what do I get” at a glance 6 to 9 tiles 4. Open roles list The conversion engine of the page One row per role, no pagination under 25 roles 5. Hiring process Removes anxiety, reduces drop-off before applying 3 to 5 steps with timing 6. Proof Team quotes, photos, review scores 2 to 3 short quotes 7. Application form Captures the applicant with minimum friction 5 to 7 fields 8. Talent pool fallback Catches interest when nothing is open Email + role interest, 2 fields Section 1: The hero The hero is where most careers pages waste their best real estate on a stock photo of people high-fiving. Keep it functional. The point is broken down further in this analysis. Layout Left-aligned text block, image or short muted video on the right (or a full-width photo of your actual team behind a dark overlay). One primary button: View open roles, anchored to the jobs list further down the page. A small counter is useful and honest: “7 open roles across 3 teams”. On mobile, stack text above the image and keep the button above the fold. Copy Write the headline as a statement about the work, not about the company’s ambition. Compare: Weak: “Join our journey to change the world.” Better: “Build software for 400 independent pharmacies, in a team of nine.” Specific numbers do two things: they filter out mismatched applicants and they signal that a real human wrote the page. Section 2: The culture blurb This is the section that separates a careers page from a job board listing. It should be short, concrete, and slightly uncomfortable to write, because it should say something a competitor cannot copy and paste. What to include How you work: meeting load, remote or hybrid policy with actual days, async or synchronous, tooling. How decisions get made: who signs off on what, how much autonomy a new hire really gets. Who thrives here: one sentence describing the person who does well, and one describing who does not. That last point is the highest-value sentence on the whole page. “If you want a structured onboarding programme and a defined career ladder, we are probably too small for you right now” will lose you applicants you did not want and win you trust with the ones you did. Career page design: How to do it right covers this in more depth. Layout tip Break the blurb into two or three short paragraphs of 40 words or fewer, or use a two-column layout with a heading on the left and text on the right. Walls of text in this section get skipped on mobile. Section 3: The benefits grid Candidates scan this. Design for scanning. Layout rules Three columns on desktop, two on tablet, one on mobile. Equal-height cards. Icon or small illustration, a 3 to 5 word label in bold, then one line of detail underneath. Six to nine tiles. Fewer looks thin, more looks like padding. Never use an icon font that fails to load. Inline SVG is safer and faster. Copy rules Quantify everything you can. “Generous holiday” means nothing. “28 days plus public holidays, plus the week between Christmas and New Year” means something. Same for learning budgets, equipment allowances, pension contributions and parental leave. Vague Specific Flexible working Core hours 10:00 to 15:00, the rest is yours Great equipment Laptop of your choice plus a 400 EUR home desk budget Room to grow 1,500 EUR per year for courses and conferences, no approval needed under 300 EUR Competitive salary Published band on every job listing Section 4: The open roles list This is where the page earns its keep. Treat it as a product listing, not a footer link dump. Structure Group by department if you have more than six roles. Otherwise a single flat list is faster to scan. Each row shows: job title, department, location, employment type, and salary band if you publish one. The whole row is clickable, not just the title. Minimum touch target of 44 pixels in height. Filters only if you have 15+ roles. Below that, filters add friction rather than remove it. Every role gets

How to Design a Careers Page That Attracts Better Job Applicants Read More »

About Us

Express Jam Studio was founded in 2004 by John Smith. John had previously worked for a courier company, but he saw an opportunity to start his own business in the web design and development industry.

Contact Info

Copyright © 2022 Express Jam Studio. All Rights Reserved.