Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk5 min

CSS Transforms and Transitions: How to Use Them

Transforms change an element’s visual position or shape without reflowing the page; transitions control how property changes unfold over time. Here’s how to use them together and account for reduced motion.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use transform to change an element’s visual position or shape; use transition to make a property change unfold over time. They work together, but solve different parts of an effect: a hover or focus rule supplies the new transform value, and the transition controls how the browser moves between values.

What is the difference between a transform and a transition?

A CSS transform changes an element’s visual coordinate space. It can move, rotate, scale, skew, or apply a 3D transformation to an element. The transformed element does not take up a newly sized or positioned space in normal document flow, so surrounding content does not reflow to follow its visual position. If neighboring content must move to make room, change the layout rather than relying on a transform. See MDN’s transform property reference and guide to using transforms.

A transition describes how a change in a CSS property is interpolated over time. It specifies the property to animate, duration, timing function and optional delay. It does not choose the new value: a state change, such as a hover, keyboard focus or added class, must provide it. MDN explains the controls in its CSS transitions guide.

How do I move an element with CSS?

Set a starting transform, then assign a different value in the state where the movement should occur. Add a transition to the base rule to make the change gradual:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
.card {
  transform: translateY(0);
  transition: transform 180ms ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-4px);
}

translateY(-4px) visually moves the card upward by four CSS pixels. The transition makes that transform change take 180 milliseconds with an easing curve. The matching :focus-visible rule lets keyboard users receive the movement when focusing the card, assuming the card is an interactive or focusable element. Do not add focusability to a non-interactive element solely to reproduce a hover effect.

The movement does not change the card’s original layout space. If it overlaps nearby content, check spacing and stacking rather than expecting the surrounding page to rearrange.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Which transform function should I use?

Choose the function that expresses the visual change you need. MDN documents the transform functions and their composition in its transforms guide.

Effect Function Example
Move translate(), translateX() or translateY() transform: translate(12px, -4px);
Rotate rotate() transform: rotate(6deg);
Resize visually scale() transform: scale(1.05);
Slant skew() transform: skewX(8deg);
Apply a 3D effect 3D functions such as perspective() and rotateY() transform: perspective(600px) rotateY(12deg);

You can list several functions in one transform declaration. Their written order matters because they compose in that order; changing the order can change the result. Use transform-origin to change the point around which a transform operates. The separate translate, rotate and scale properties are also available. MDN documents their application order as translate, rotate, scale, then transform.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

How do I choose transition timing?

The transition shorthand commonly accepts a property, duration, timing function and delay:

transition: transform 180ms ease 0s;

In this example, only changes to transform are transitioned; the duration is 180 milliseconds, the easing is ease, and the delay is zero. Start with a duration that makes the change easy to perceive without making the interaction feel sluggish, then check the result in context. Use a specific property name instead of all by default: a broad transition can animate unrelated property changes and make the effect harder to predict.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Do not depend on transitions to or from auto as a reliable animation endpoint. MDN cautions that user-agent behavior can differ and recommends avoiding those transitions. Choose values that can be interpolated predictably instead.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How do I respect reduced-motion preferences?

People can request less motion through their device or operating-system settings. For non-essential movement, use the prefers-reduced-motion media query to remove or reduce the animation while keeping the interface understandable and usable:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
.card {
  transform: translateY(0);
  transition: transform 180ms ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-4px);
}

@media (prefers-reduced-motion: reduce) {
  .card {
    transition: none;
  }

  .card:hover,
  .card:focus-visible {
    transform: none;
  }
}

The reduced-motion rule suppresses both the animated transition and this non-essential movement. Make sure the hover or focus state still communicates any meaningful information without relying on motion. W3C documents this media-query approach in Technique C39. It is an example of a technique related to WCAG 2.3.3, not itself a standalone guarantee of conformance; W3C notes that techniques are not requirements. For the media feature’s definition, see MDN’s prefers-reduced-motion reference.

What can go wrong?

  • The element jumps instead of moving gradually: Put the transition on the base rule, and confirm that the state change modifies the property named in the transition.
  • Nearby content does not move with the element: That is expected for transforms; they change visual presentation, not normal-flow layout. Use a layout change if other content must reflow.
  • The transform seems to rotate or scale around the wrong point: Set an appropriate transform-origin.
  • The result changes when transform functions are reordered: Function order affects how transformations compose; keep the order that produces the intended result.
  • A large transition animates unrelated changes: Replace all with the property or properties that should transition.
  • A positioned descendant behaves unexpectedly: A transform value other than none creates a stacking context and can make the transformed element the containing block for positioned descendants. This can affect z-index expectations and cause a position: fixed descendant to behave relative to the transformed ancestor rather than the viewport.
  • Movement remains when reduced motion is requested: Check that the media query targets the same element and interaction states as the default rules, and verify that the reduced-motion state remains clear without animation.

Learn and test the effect

For a broader guided learning path, MDN’s Transform & animate CSS curriculum covers this area. Test transforms and transitions with pointer and keyboard interaction, and check the reduced-motion state as well as the default presentation.

Or skip the browser setup

If you need a screenshot of a page showing a CSS effect, you can request one from ScreenshotNeo with a single GET call. Replace the target URL with your page’s address and use your API key:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. ScreenshotNeo can accept cookie or consent banners and remove more than 60 known consent platforms, newsletter popups and chat widgets before capture; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads and cache hits are not billed, and the response identifies the page verdict and billing status in headers. Its MCP server provides screenshot tools for AI agents, including Claude, Cursor and other MCP clients. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots. Learn more at ScreenshotNeo.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.