Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix 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 desk3 min

How to Rotate Text with CSS: `transform` vs. Vertical Writing

Use transform: rotate() to turn a whole text element; use writing-mode and text-orientation when you want vertical text flow.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To turn a heading, label, or whole line as one unit, use transform: rotate(...). To make text flow vertically, use writing-mode and, when needed, text-orientation. These techniques solve different layout problems: a transform changes how an element is drawn, while writing-mode changes the text flow.

Choose the right CSS technique

Goal Use What changes
Turn a complete heading, label, or line by a chosen angle transform: rotate(...) The element’s visual rendering around a pivot
Lay out text vertically writing-mode, with optional text-orientation Text flow and character orientation

MDN describes writing-mode as setting whether lines are laid out horizontally or vertically and the direction in which text flows. MDN’s CSS writing modes guide explains the broader model.

As an Amazon Associate I earn from qualifying purchases.

Rotate a whole text element with transform

Use rotate() when the text should turn as a single visual object—for example, a sidebar label or angled heading. A positive angle rotates clockwise in a left-to-right context; a negative angle rotates in the opposite direction.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<h2 class="rotated-label">Featured</h2>
.rotated-label {
  display: inline-block;
  transform: rotate(-90deg);
  transform-origin: top left;
}

The default pivot is the element’s center. Set transform-origin to choose another point, such as top left, and adjust surrounding layout after applying the transform. The visual result can extend beyond the space the element would otherwise occupy, so check for overlap and unwanted gaps. See MDN’s rotate() reference.

#1 Best Overall
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

Angles, origins, and transform order

  • Use degrees such as rotate(90deg) or rotate(-90deg); choose the direction that suits the design.
  • In right-to-left contexts, the direction associated with a positive angle is reversed.
  • When combining transforms, their written order matters: changing the order can change the result. Check the MDN transform reference for transform behavior.

Set text vertically with writing-mode

Choose a vertical writing mode when the text should follow a vertical flow rather than simply be turned as a graphic. The two common directions are vertical-rl and vertical-lr.

.vertical-heading {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

text-orientation applies in vertical writing modes. Its default, mixed, turns horizontal-script characters 90 degrees while allowing vertical-script characters to appear naturally. Choose upright to keep characters upright or sideways to display the line turned sideways. Consult the MDN references for writing-mode and text-orientation.

Check layout, browser support, and motion

  • Check the actual footprint. A transform changes visual rendering around a pivot; inspect nearby content and spacing rather than assuming the rotated element reserves space in its new visual position.
  • Test the intended writing-mode value. MDN marks rotate() and text-orientation as widely available, with listed availability since July 2015 and September 2020 respectively. MDN lists writing-mode as widely available since March 2017, while noting that support varies for some parts. Check the compatibility table for the exact value and target browsers.
  • Prefer writing-mode for vertical flow. A transform-based workaround for a writing-mode value can produce unexpected positioning or rendering. Test the actual script and layout instead of treating the two approaches as interchangeable.
  • Respect reduced motion for animated rotations. A static rotated label is not an animation, but animated rotation can cause accessibility problems. Avoid unnecessary motion and honor prefers-reduced-motion when rotation is animated.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If you need a screenshot of the result rather than a local browser capture, ScreenshotNeo can return a screenshot through one GET request. For example, this cURL command requests a WebP capture of a page containing your CSS:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
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 options. Cookie banners, newsletter popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for free.

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 *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

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.