Implementing Virtualization on a Mini PC

A new era of computing where portability and power are combined has arrived with the introduction of Mini PCs. These small but powerful devices are now more than just media centers or low-power workstations, which was their original function. Virtualization is one of the more complex tasks that Mini PCs can handle today. The technology of virtualization enables the creation of numerous virtual instances or machines on a single physical host. Not only have data centers been transformed by this innovation, but home users, developers, and small businesses looking to maximize their computing resources now can not live without it.

The implementation of virtualization on a Mini PC is the focus of this essay. It examines the benefits of using Mini PCs for virtualization, discusses the difficulties, and offers a comprehensive step-by-step tutorial for establishing a virtualized environment on these small computers. This discussion has made it clear that Mini PCs are a flexible and affordable option for those looking to take advantage of virtualization’s power.

Mastering MERN Full Stack Development

Imagine awakening one day with an idea for your digital product and feeling excited yet overwhelmed at where to begin. If this has ever crossed your mind, you've come to the right place. Contrary to popular belief, selecting an effective tech stack does not involve choosing an investment alone. Businesses must carefully choose their technology stack to achieve rapid web development while providing exceptional user experiences — MERN stack is often recommended as a starting point for app development projects.

MERN

What Is MERN?

The MERN stack is a set of powerful yet resilient technologies used to build scalable web apps, from front-end and back-end elements through database components and their interaction. Popular with startups, its simplicity has earned its widespread adoption as an easy JavaScript full-stack framework perfect for dynamic websites and app development.

Data Privacy and Cloud Computing: A Review of Security and Privacy Measures

In the digital era, where data has become the backbone of businesses, it becomes very important to ensure its security and privacy. The huge growth in cloud computing, wherein data is stored and processed remotely, gave rise to various measures for security and privacy. Within these parameters, we would delve into the realm from where data privacy within the context of cloud computing would be discussed. Within this context, we would discuss those measures that have been put into place to tackle these concerns.

Understanding Data Privacy and Cloud Computing

Cloud computing is storing and processing data on remote servers accessed through the Internet. This paradigm shift has brought convenience and scalability. It also brings potential vulnerabilities to data breaches.

Top 8 Features for NodeJS Web Development

NodeJS is an open-source, cross-platform tool created by Ryan Dahl in 2009 that essentially offers a runtime environment for JavaScript to execute outside of the browser. Asynchronous programming is used.

It's based on the JavaScript V8 engine and may operate in a variety of browsers, namely Chrome, or as a standalone application. NodeJS web development is capable of handling server requests with ease.

Optimizing Airflow: A Case Study in Cloud Resource Efficiency

Throughout my career, I've worked with many companies that required an orchestration tool for a limited amount of time per day. For example, one of my first freelance clients needed to run an Airflow instance for only 2-3 hours per day, resulting in the instance being idle the rest of the time and wasting money.

Because it wasn't a large company, the client asked if I could intervene. The infrastructure was hosted on Google Cloud, which I was familiar with.

Stable Diffusion XL: The New Model From Stable AI

Among the outstanding advances in image generation through artificial intelligence is Stable Diffusion, a powerful tool that has revolutionized the creation of visual content. Stability AI aims to maintain its leading position in generating images from text with the recent release of its Stable Diffusion XL 1.0 image generator. ‘XL’ refers to the fact that it has been trained with almost three times more parameters than its previous models.

Today we will talk about this new model and what improvements it brings and also explore the interactive system in image generation using artificial intelligence, thus introducing the revolutionary Stable Diffusion XL Turbo.

Unlocking Efficiency: The Utility of Mini PCs in Virtualization

Virtualization has become a crucial element for companies and individuals looking to optimize their computing resources in today’s rapidly changing technological landscape. This ground-breaking method enables users to run multiple virtual machines on a single physical server, increasing flexibility, lowering hardware costs, and improving efficiency. Mini PCs have become effective virtualization tools in this setting, providing a portable yet effective solution for a variety of applications. Virtualization has become a key player in the constantly changing computing landscape. It enables organizations and people to run various operating systems and applications on a single physical machine, maximizing resources and boosting effectiveness. The main platforms for virtualization have historically been traditional servers and desktops, but the introduction of mini PCs has ushered in a new era of portable yet potent virtualization solutions.

Virtualization has become a game-changer for both businesses and individuals in the rapidly changing world of technology. Virtualization provides a flexible and effective solution for everyone, from professionals managing intricate server networks to enthusiasts testing out various operating systems. The mini PC is one of the key elements that has fundamentally changed virtualization. In this article, we’ll explore the utility of mini PCs in virtualization and how they contribute to seamless and cost-effective virtualization environments.

9 Best Credit Card Processing Plugins for WordPress (Compared)

Are you looking for the best credit card processing plugins?

Credit card processing plugins are the best way to accept online payments on your WordPress site. They support many payment options, providing flexibility for customers with different preferences and reducing cart abandonment.

In this article, we’ll compare the best credit card processing plugins and tell you how to pick the right one for your business.

Best credit card processing plugins

Why Do You Need a Credit Card Processing Plugin for Your WordPress Site?

There is no getting around the need for a credit card processing plugin if you plan to sell products, services, or subscriptions through your website.

Redirecting customers to external payment gateways can be a hassle and may lead to cart abandonment. Rather than directing customers to leave your site and go to a payment gateway’s website, such as PayPal or Square, a credit card processing plugin integrates with WordPress.

This allows you to accept and authenticate digital payment information from your customers without exiting the page. That way, you provide a seamless and convenient payment experience.

For membership websites, credit card processing plugins often support recurring payments, allowing customers to set up automatic payments for ongoing services.

But before you begin, make sure you enable HTTP/SSL on your WordPress site so you can securely accept online payments.

If you’re unsure how to do that, follow our beginner’s guide on how to get a free SSL certificate for your WordPress Website.

Now that you know why they’re important, let’s compare the best credit card processing plugins in the market.

1. Easy Digital Downloads

Is Easy Digital Downloads the right digital eCommerce platform for you?

Easy Digital Downloads (EDD) is a powerful plugin for selling digital products, including software, PDFs, eBooks, documents, and other downloadable content.

With EDD, you can process unlimited transactions, sell unlimited products, and, best of all, there are no monthly fees.

The plugin comes with several built-in payment gateways: Paypal and Stripe. Besides the popular and standard payment gateways available out of the box, EDD offers additional payment addons to appeal to more customers. This includes Authorize.net, Braintree, ClickBank, and more.

Easy Digital Downloads payment gateways

Aside from collecting one-time payments, you can charge recurring subscription fees on any digital products. The plugin will automatically charge customers based on any time period you set, including daily, weekly, monthly, quarterly, semi-annually, or yearly.

On top of that, it’s super simple to set up. The EDD plugin automatically creates product pages, cart pages, and checkout pages for you. And you can customize those payments with a buy button, log-in, cart widget, and order history, just to name a few.

You’ll even have a Reports dashboard in WordPress to show all earnings, refunds, and the average order value. That can even be broken down based on the different payment gateways you use.

Easy Digital Downloads payment gateway reports

Learn more about EDD with our beginner’s guide on how to sell digital downloads on WordPress.

Pricing: A free version of Easy Digital Downloads is available, which supports PayPal, Stripe, and Amazon Pay. But if you choose their All Access Plan at $499.50 per year, you get access to their entire addon catalog. That means you don’t need to install and purchase payment gateway addons individually.

2. WP Simple Pay

Is WP Simple Pay the right Stripe payment plugin for your WordPress website?

WP Simple Pay is the best Stripe payments plugin for WordPress. It lets you easily collect both one-time and recurring payments directly from your site.

If you don’t own an e-commerce site and just want a simple way to accept transactions for your services, WP Simple Pay is for you. Using the drag and drop form builder, you can quickly create any type of payment form. Since Stripe is a highly reputable payment gateway, you’ll build trust with visitors and increase conversions.

WP Simple Pay supports multiple currencies and allows you to add intuitive, clean payment forms on your site. They also support over 10 payment methods, including ACH Direct Debit, Alipay, Afterpay, Klarna, and more.

One of the best parts about WP Simple Pay is that you can offer a free trial period to users before an invoice is billed. This is a great way to increase signups for a subscription service.

And they support ‘Buy Now Pay Later’ options, allowing your customers to make impulse purchases since they pay in smaller, more manageable amounts.

WP Simple Pay is one of the best plugins for customization, too. It comes with 70+ ready-made payment form templates to fit your use case.

WP Simple Pay form templates

Whether you need a donation form, subscription payment form, ACH direct debit payment form, or anything else, there’s a good chance you’ll find what you’re looking for.

To learn more, read our in-depth guide on how to allow users to choose a payment method on WordPress forms.

Pricing: WP Simple Pay offers a free version that automatically connects with Stripe Checkout and most major credit and debit cards. The paid plans give you advanced functionality, such as the ability to accept recurring payments, set up automatic billing, offer ‘Buy Now, Pay Later’ options, and more.

3. WPForms

WPForms

WPForms is the best form builder plugin for WordPress. You can quickly create many types of forms, including booking forms, contact forms, and more. With over 5 million website owners using WPForms on their WordPress site, it’s one of the most trusted plugins out there.

The plugin offers several payment gateways, such as PayPal, Stripe, and Square, Authorize.net. All you have to do is install the addons and connect to your payment gateway account so you can begin accepting payments.

The best part is that the free version of WPForms lets you use Stripe payments for free.

Stripe credit card in WPForms

WPForms is great for subscription services or small businesses that do not need a product or checkout page.

For example, let’s say you sold a monthly beauty box subscription. You can create a form so users can pick out the type of beauty box they want and enter their shipping information.

WPForms beauty box subscription

For more details, check out our guide on how to create a WordPress form with payment options.

Pricing: WPForms is free to use, and you can accept Stripe payments with the Lite version. You’ll need the Pro version to choose other payment gateway add-ons. Plans for WPForms Pro start at $49.50 per year, which is more affordable than most form builder plugins.

4. MemberPress

MemberPress

MemberPress is a popular membership plugin that offers advanced features to manage your membership site.

For instance, this plugin lets you accept credit card payments, create gated content, add membership levels, make members-only forums, restrict access based on different membership levels, and more.

It’s hands down the best plugin for course creators looking to sell online courses, premium content behind a paywall, or group membership plans.

MemberPress supports the most popular payment solutions, such as Stripe, PayPal, and Authorize.net.

Payments in MemberPress

With MemberPress, you have everything you need to build a membership site from scratch. You can do everything from create pricing pages, add signup forms, add members-only content, customize membership email templates, build group forums, etc.

If you plan on using MemberPress, check out our ultimate guide to creating a WordPress membership site.

Pricing: MemberPress is a premium plugin that begins at $179.50 per year for one site.

5. WooCommerce

WooCommerce payments

WooCommerce is the most popular and well-known e-commerce plugin for WordPress.

You can accept payments from all of the major credit card providers, including Mastercard, Visa, American Express, and more.

By default, your store will only accept direct bank transfers, check payments, and cash on delivery.

If you want all of the popular payment gateways like WooPayments, Stripe, PayPal, Square, Klarna, and Amazon Pay, you’ll need to download them as an addon from the extensions store. The good news is many are free to download.

WooCommerce payment gateways

WooCommerce is best suited for selling physical products since it allows you to quickly set up your online store, create product pages, customize the checkout process, manage inventory, and process payments, all in one place.

WooCommerce has plenty of apps in its marketplace to help improve the checkout experience. For example, adding related items or a countdown timer in the shopping cart can boost your sales.

To learn how to set up a WooCommerce store, read our comprehensive tutorial on WooCommerce made simple.

Pricing: WooCommerce is free to get started, and so are all of the payment gateways within the WooCommerce marketplace. However, most people end up paying for other apps or themes to enhance their online store.

6. Accept Stripe Payments

Accept Stripe payments plugin

Accept Stripe Payments is a free WordPress plugin that allows users to process payments via Stripe.

It uses a simple shortcode that allows you to add the Stripe ‘Buy Now’ button anywhere on your website for a product or service. Also, you can accept donations via Stripe.

When users click on the buy button, a Stripe pop-up will appear, asking users to enter their credit card information to complete the purchase.

test purchase

Your customers are redirected to the Checkout Result page once they’ve entered their credit card payment.

The page will display the transaction and the item they just paid for.

Checkout-result page

Within WordPress, the transaction will be captured in the orders menu of the plugin. You can easily view all orders you’ve received in your WordPress dashboard.

Also, the plugin offers very basic features to create and customize a product page. Since it’s a free plugin, it doesn’t offer nearly the features that other e-commerce platforms do, such as WooCommerce, Easy Digital Downloads, or even Shopify.

For full details about adding Stripe as a payment method, check out our tutorial on how to accept payments with Stripe in WordPress.

Pricing: The Accepts Stripe Payments plugin is free to use. However, they do offer addons that you can purchase individually or in a bundle. For example, you can purchase addons like Subscription payments, Apple and Google Pay, Alipay, and others. It costs $39.95 per addon, or you can get access to all premium addons for $79 per year.

7. LearnDash

LearnDash

LearnDash is the most advanced WordPress learning management software (LMS) plugin. This plugin is designed to help build a paid community around digital courses.

As a user, you have complete control over who can access your courses and for how long.

You can also provide exclusive perks and curate courses to build membership plans and packaged deals.

As soon as a person signs up, they’ll instantly receive access to all the content in the membership plan.

And if you plan to sell memberships, LearnDash works with MemberPress.

When it’s time to collect your funds, LearnDash accepts payments using several payment gateways, including Stripe, PayPal, and 2Checkout.

Pricing: LearnDash starts at $199 per year for access to one site, which includes updates and support.

8. WP Charitable

WPCharitable

WP Charitable is a top-rated WordPress donation and fundraising plugin, with over 10,000 + non-profit organizations and website owners who use this plugin to raise more money online.

The beauty of this plugin is that it does not charge processing fees, so more money goes towards supporting your cause.

It comes with all the features you’ll need, such as the ability to accept both one-time and recurring donations, customizable donation forms, GDPR compliance, and more.

Best of all, Charitable has built-in payment integrations for PayPal, Stripe, Paystack, GoCardless, Braintree, Mollie, Windcave, and more.

If you’re a non-profit looking to raise money, make sure to read our guide on how to add a PayPal Donate button in WordPress.

Pricing: Charitable is free to use, and you’ll get access to PayPal and Stripe integrations. You can also create unlimited fundraising campaigns. However, the paid plans allow for premium payment gateways, recurring donations, crowdfunding, and more.

9. YITH WooCommerce Stripe

YITH WooCommerce Stripe

YITH WooCommerce Stripe is an addon plugin that allows you to accept credit card payments through Stripe on your WooCommerce store.

YITH is a trusted and well-known plugin developer that has some of the best apps for WooCommerce stores, including the:

This plugin lets you automatically process payments, so you can reduce the rate of abandoned carts and offer a positive buying experience.

It has other features, such as the ability to:

  • Show the customer’s credit card list on the checkout process, making it easier to complete the purchase.
  • Create a blacklist of users to reject payments from potential fraudulent visitors.
  • Process refunds with a single click.
  • Manage recurring payments for subscription products with YITH Subscription.
  • Ask for additional info like their billing address and zip code for verification of the credit card owner and to prevent chargebacks.

Pricing: The YITH WooCommerce Stripe plugin costs $79.99 per year, which includes one year of updates and support, along with a 30-day money-back guarantee.

What to Look for in Credit Card Processing Payment Plugins

When picking a WordPress plugin for accepting credit cards for your site or online store, it’s important to consider various factors to ensure you choose the one that best fits your needs. Here are a few aspects to look for:

  • Security features: Security and compliance should be at the top of the list. Look for payment plugins that offer PCI compliance, robust encryptions, and other security measures to protect your customer’s payment data. Also, look for fraud detection and prevention features, such as address verification and CVV checks.
  • Payment gateway options: Check which credit card types and payment methods (e.g., debit cards, digital wallets, cryptocurrencies) the plugin supports to accommodate a wide range of customers. For example, Stripe makes up over 68% of the market share for e-commerce payment processing in the U.S., so it’s important to have Stripe as a payment option.
  • Support and updates: Confirm the plugin releases consistent updates and offers reliable customer support. That way, should an error arise, the support team can help you quickly accept payments again so you don’t lose customers.
  • Customization options: Plugins that let you customize payment forms and checkout pages can boost conversion rates. You can align your payment process with your brand identity and deliver a consistent user experience. This may include customizing button colors or adding Buy Now buttons.
  • Ease of use: The plugin should have a user-friendly interface so it’s easy to set up, even for beginners. Users should be able to adjust payment settings and manage features without encountering confusion.
  • Advanced features: If you offer subscription-based services or products, ensure the plugin supports recurring payments. On top of that, it should have built-in reporting and analytics tools to gain insights into your sales data. Some plugins integrate with analytics tools like MonsterInsights so that you can track your traffic sources, sales metrics, and conversions. That way, you know where your sales are coming from and which products or services are selling the most.

By carefully considering these factors, you can pick a WordPress payment plugin that aligns with your business needs.

Of the options above, we recommend WPForms Lite so you can begin accepting Stripe payments immediately, and if you’re selling entirely digital products, you can’t go wrong with Easy Digital Downloads.

We hope this article has helped you pick the best credit card processing plugin for your site. You may want to check out our post on the best WooCommerce plugins for your store or the best WordPress coupon code plugins for your online store.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post 9 Best Credit Card Processing Plugins for WordPress (Compared) first appeared on WPBeginner.

New CSS Viewport Units Do Not Solve The Classic Scrollbar Problem

Browsers shipped a new set of CSS viewport units in 2022. These units make it easier to size elements in mobile browsers, where the browser’s retractable UI affects the height of the viewport as the user scrolls the page. Unfortunately, the new units do not make it easier to size elements in desktop browsers, where classic scrollbars affect the width and height of the viewport.

The following video shows a desktop browser with classic scrollbars. As we resize the viewport (dashed line) in different ways, the CSS length 100dvw matches the width of the viewport in all situations except when a vertical classic scrollbar is present on the page. In that case, 100dvw is larger than the viewport width. This is the classic scrollbar problem of CSS viewport units. When the page has a vertical classic scrollbar, the length 100dvw is larger than the viewport width. In fact, all viewport units have this problem.

In desktop browsers, the size of the viewport can change as well (e.g., when the user resizes the browser window, opens the browser’s sidebar, or zooms the page), but there is no separate “small viewport size” and “large viewport size” like in mobile browsers.

So far, I’ve only talked about the “viewport,” but there are, in fact, two different viewports in web browsers: the visual viewport and the layout viewport. When the page initially loads in the browser, the visual viewport and the layout viewport have the exact same size and position. The two viewports diverge in the following two cases:

  1. When the user zooms in on a part of the page via a pinch-to-zoom or double-tap gesture, the part of the page that is visible on the screen is the visual viewport. The size of the visual viewport (in CSS pixels) decreases because it shows a smaller part of the page. The size of the layout viewport has not changed.
  2. When the browser’s virtual keyboard appears on mobile platforms, the smaller part of the page that is visible on the screen above the keyboard is once again the visual viewport. The height of the visual viewport decreases with the height of the virtual keyboard. The size of the layout viewport has again not changed.

It’s worth noting that as part of shipping the new viewport units in 2022, Chrome stopped resizing the layout viewport and initial containing block (ICB) when the virtual keyboard is shown. This behavior is considered the “the best default”, and it ensures that the new viewport units are consistent across browsers. This change also made the mobile web feel less janky because resizing the ICB is a costly operation. However, the virtual keyboard may still resize the layout viewport in some mobile browsers.

In these two cases, the visual viewport continues to be “the rectangular section of the web browser in which the web page is rendered,” while the layout viewport becomes a larger rectangle that is only partially visible on the screen and that completely encloses the visual viewport. In all other situations, both viewports have the same size and position.

One benefit of the two-viewport system is that when the user pinch-zooms and pans around the page, fixed-positioned elements don’t stick to the screen, which would almost always be a bad experience. That being said, there are valid use cases for positioning an element above the virtual keyboard (e.g., a floating action button). The CSS Working Group is currently discussing how to make this possible in CSS.

CSS viewport units are based on the layout viewport, and they are unaffected by changes to the size of the visual viewport. Therefore, I will focus on the layout viewport in this article. For more information about the visual viewport, see the widely supported Visual Viewport API.

The Two Types Of Zoom

The two types of zoom are defined in the CSSOM View module:

“There are two kinds of zoom: page zoom, which affects the size of the initial viewport, and the visual viewport scale factor, which acts like a magnifying glass and does not affect the initial viewport or actual viewport.”

Page zoom is available in desktop browsers, where it can be found in the browser’s menu under the names “Zoom in” and “Zoom out” or just “Zoom”. When the page is “zoomed in,” the size of the layout viewport shrinks, which causes the page to reflow. If the page uses CSS media queries to adapt to different viewport widths (i.e., responsive web design), those media query breakpoints will be triggered by page zoom.

Scale-factor zoom is available on all platforms. It is most commonly performed with a pinch-to-zoom gesture on the device’s touch screen (e.g., smartphone, tablet) or touchpad (e.g., laptop). As I mentioned in the previous section, the size of the layout viewport does not change when zooming into a part of the page, so the page does not reflow.

Page Zoom Visual Viewport Scale Factor
Available on Desktop platforms All platforms
Activated by Keyboard command, menu option Pinch-to-zoom or double-tap gesture
Resizes Both layout and visual viewport Only visual viewport
Does it cause reflow? Yes No
The Layout Viewport And The Initial Containing Block

The layout viewport is the “containing block” for fixed-positioned elements. In other words, fixed-positioned elements are positioned and sized relative to the layout viewport. For this reason, the layout viewport can be viewed as the “position fixed viewport,” which may even be a better name for it.

/* this element completely covers the layout viewport */
.elem {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

Here’s a tip for you: Instead of top: 0, bottom: 0, left: 0, and right: 0 in the snippet above, we can write inset: 0. The inset property is a shorthand property for the top, bottom, left, and right properties, and it has been supported in all major browsers since April 2021.

The initial containing block (ICB) is a rectangle that is positioned at the top of the web page. The ICB has a static size, which is the “small viewport size.” When a web page initially loads in the browser, the layout viewport and the ICB have the exact same size and position. The two rectangles diverge only when the user scrolls the page: The ICB scrolls out of view, while the layout viewport remains in view and, in the case of mobile browsers, grows to the “large viewport size.”

The ICB is the default containing block for absolutely positioned elements. In other words, absolutely positioned elements are, by default, positioned and sized relative to the ICB. Since the ICB is positioned at the top of the page and scrolls out of view, so do absolutely-positioned elements.

/* this element completely covers the ICB by default */
.elem {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

The ICB is also the containing block for the <html> element itself, which is the root element of the web page. Since the ICB and the layout viewport initially have the same size (the “small viewport size”), authors can make the <body> element as tall as the initial viewport by setting height to 100% on both the <html> and <body> element.

/* By default: ICB height = initial viewport height */

/* <html> height = ICB height */
html {
  height: 100%;
}

/* <body> height = <html> height */
body {
  margin: 0;
  height: 100%;
}

/* Result: <body> height = initial viewport height */

Some websites, such as Google Search, use this method to position the page footer at the bottom of the initial viewport. Setting height to 100% is necessary because, by default, the <html> and <body> elements are only as tall as the content on the page.

Layout Viewport Initial Containing Block
Containing block for position: fixed elements position: absolute elements
Is it visible? Always in view (at least partially2). Scrolls out of view (positioned at the top of the page).
Size Small or large viewport size (depending on the browser UI) Small viewport size

2 The layout viewport is not fully visible when the user zooms in on the part of the page and when the browser’s virtual keyboard is shown.

The New Viewport Units

The CSS viewport units are specified in the CSS Values and Units Module, which is currently at Level 4. The original six viewport units shipped in browsers a decade ago. The new units shipped in major browsers over the past year, starting with Safari 15.4 in May 2022 and ending with Samsung Internet 21 in May 2023.

Note: The new viewport units may not be correctly implemented in some mobile browsers.

Layout Viewport Original Units (2013) New Unit Equivalent (2022)
Width vw svw, lvw, dvw
Height vh svh, lvh, dvh
Inline Size vi svi, lvi, dvi
Block Size vb svb, lvb, dvb
Smaller Size vmin svmin, lvmin, dvmin
Larger Size vmax svmax, lvmax, dvmax

A few clarifications:

  • The “inline size” and “block size” are either the width or the height, depending on the writing direction. For example, in writing systems with a left-to-right writing direction, the inline size is the width (vi is equivalent to vw), and the block size is the height (vb is equivalent to vh).
  • The ”smaller size” and “larger size” are either the width or the height, depending on which one is larger. For example, if the viewport is rather tall than it is wide (e.g., a smartphone in portrait mode), then the smaller size is the width (vmin is equivalent to vw), and the larger size is the height (vmax is equivalent to vh).
  • Each viewport unit is equal to one-hundredth of the corresponding viewport size. For example, 1vw is equal to one-hundredth of the viewport width, and 100vw is equal to the entire viewport width.

For each of the six original units, there are three new variants with the prefixes s, l, and d (small, large, and dynamic, respectively). This increases the total number of viewport units from 6 to 24.

  • The s-prefixed units represent the “small viewport size.”
    This means that 100svh is the height of the initial layout viewport when the browser’s UI is expanded.
  • The l-prefixed units represent the “large viewport size.”
    This means that 100lvh is the height of the layout viewport after the browser’s UI retracts. The height difference between the large and small viewport sizes is equivalent to the collapsible part of the browser’s UI:

100lvh - 100svh = how much the browser’s UI retracts

  • The old unprefixed units (i.e., vw, vh, and so on) are equivalent to the l-prefixed units in all browsers, which means that they also represent the “large viewport size.” For example, 100vh is equivalent to 100lvh.
  • The d-prefixed units represent the current size of the layout viewport, which can be either the “small viewport size” or the “large viewport size.” This means that 100dvh is the actual height of the layout viewport at any given point in time. This length changes whenever the browser’s UI retracts and expands.
Why Do We Have New CSS Units?

In previous years, the Android version of Chrome would resize the vh unit whenever the browser’s UI retracted and expanded as the user scrolled the page. In other words, vh behaved like dvh. But then, in February 2017, Chrome turned vh into a static length that is based on the “largest possible viewport”. In other words, vh started behaving like lvh. This change was made in part to match Safari’s behavior on iOS, which Apple implemented as a compromise:

“Dynamically updating the [100vh] height was not working. We had a few choices: drop viewport units on iOS, match the document size like before iOS 8, use the small view size, or use the large view size.

From the data we had, using the larger view size was the best compromise. Most websites using viewport units were looking great most of the time.”

With this change in place, the same problem that occurred in iOS Safari also started happening in Chrome. Namely, an element with height: 100vh, which is now the “large viewport size,” is taller than the initial viewport, which has the “small viewport size.” That means the bottom part of the element is not visible in the viewport when the web page initially loads. This prompted discussions about creating a solution that would allow authors to size elements based on the small viewport size. One of the suggestions was an environment variable, but the CSS Working Group ultimately decided to introduce a new set of viewport units.

/* make the hero section as tall as the initial viewport */
.hero {
  height: 100svh;
}

The same height can be achieved by setting height to 100% on the .hero element and all its ancestors, including the <body> and <html> elements, but the svh unit gives authors more flexibility.

I wasn’t able to find any good use cases for the dvh unit. It seems to me that sizing elements with dvh is not a good idea because it would cause constant layout shifts as the user scrolled the page. I had considered dvh for the following cases:

  • For fixed-positioned elements, such as modal dialogs and sidebars, height: 100% behaves the same as height: 100dvh because the containing block for fixed-positioned elements is the layout viewport, which already has a height of 100dvh. In other words, height: 100% works because 100% of 100dvh is 100dvh. This means that the dvh unit is not necessary to make fixed-positioned elements full-height in the dynamic viewport of mobile browsers.
  • For vertical scroll snapping, setting the individual “pages” to height: 100dvh results in a glitchy experience in mobile browsers. That being said, it is entirely possible that mobile browsers could fix this issue and make scroll snapping with height: 100dvh a smooth experience.

There is no concept of a “small viewport size” and a “large viewport size” in desktop browsers. All viewport units, new and old, represent the current size of the layout viewport, which means that all width units are equivalent to each other (i.e., vw= svw = lvw = dvw), and all height units are equivalent to each other (i.e., vh = svh = lvh = dvh). For example, if you replaced 100vh with 100svh in your code, nothing would change in desktop browsers.

This behavior isn’t exclusive to desktop platforms. It also occurs on mobile platforms in some cases, such as when a web page is embedded in an <iframe> element and when an installed web app opens in standalone mode.

It is possible for the small and large viewport sizes to be equivalent even during regular web browsing in mobile browsers. I have found two such cases:

  1. In Safari on iOS, if the user chooses the “Hide Toolbar” option from the page settings menu, the browser’s UI will retract and stay retracted while the user scrolls the page and navigates to other web pages.
  2. In Firefox on Android, if the user disables the “Scroll to hide toolbar” option in Settings → Customize, the browser’s UI will completely stop retracting when the user scrolls web pages.
The Two Types Of Scrollbars

In a web browser, scrollbars can be either classic or overlay. On mobile platforms, scrollbars are exclusively overlay. On desktop platforms, the user can choose the scrollbar type in the operating system’s settings. The classic scrollbar option is usually labeled “Always show scrollbars.” On Windows, scrollbars are classic by default. On macOS, scrollbars are overlay by default (since 2011), but they automatically switch to classic if the user connects a mouse.

The main difference between these two types of scrollbars is that classic scrollbars are placed in a separate ”scrollbar gutter” that consumes space when present, which reduces the size of the layout viewport; meanwhile, overlay scrollbars, as the name suggests, are laid over the web page without affecting the size of the layout viewport.

When a (vertical) classic scrollbar appears on the page in a desktop browser with classic scrollbars, the width of the layout viewport shrinks by the size of the scrollbar gutter, which is usually 15 to 17 CSS pixels. This causes the page to reflow. The size and position of absolutely and fixed-positioned elements may also change. By default, the browser only shows a classic scrollbar when the page overflows, but the page can force the scrollbar (or empty scrollbar track) to be shown and hidden via the CSS overflow property.

To prevent the page from reflowing whenever a vertical classic scrollbar is shown or hidden, authors can set scrollbar-gutter: stable on the <html> element. This declaration tells the browser to always reserve space for the classic scrollbar. The declaration has no effect in browsers with overlay scrollbars. The scrollbar-gutter property is not supported in Safari at the time of writing this article.

A benefit of classic scrollbars is that they make it clear when an element on the page has a scrollable overflow. In comparison, overlay scrollbars are not shown unless the user actually attempts to scroll an element that is a scroll container with overflow. This can be a problem because the user may not even notice that an element contains more content than initially visible. Chrome for Android mitigates this problem by showing the overlay scrollbar until the user scrolls the element at least once.

Even if the Windows operating system switches to overlay scrollbars by default in the future, some users prefer classic scrollbars and will turn them on if possible. Therefore, developers should test in browsers with classic scrollbars and ensure that their websites remain usable.

Issues Related To Classic Scrollbars

When testing your website in a desktop browser with classic scrollbars, the two main issues to look out for are unexpected extra scrollbars caused by small amounts of overflow and empty scrollbar tracks that serve no real purpose. These are usually not major issues, but they make the website appear not quite right, which may confuse or even annoy some visitors.

Issue 1: Setting overflow To scroll Instead Of auto

Whether or not a scroll container has overflow depends on the content length, viewport width, and other factors. In situations when there is no overflow, it’s usually better to hide the scrollbar than to show an empty scrollbar track in browsers with classic scrollbars. Such an automatic scrollbar behavior can be enabled by setting overflow to auto on the scroll container.

When a website is developed on macOS, which uses overlay scrollbars by default, the developer may mistakenly set overflow to scroll instead of auto. Overlay scrollbars behave in the same manner whether overflow is set to auto or scroll. The scrollbar only appears when the user attempts to scroll an element that is a scroll container with overflow. Classic scrollbars behave differently. Notably, if overflow is set to scroll but the element does not overflow, then the browser will show empty scrollbar tracks. To avoid this problem, set overflow to auto instead of scroll.

Auto scrollbars trade the problem of empty scrollbar tracks with the problem of content reflow, but the latter problem can be avoided by setting scrollbar-gutter to stable on the scroll container, as I previously mentioned.

Issue 2: Assuming That The Full Width Of A Media Query Is Available

CSS media queries don’t take into account the fact that classic scrollbars reduce the width of the viewport. In other words, media queries assume scrollbars never exist. For example, if the width of the layout viewport is 983 pixels, and the page has a vertical classic scrollbar that is 17 pixels wide, the media query (min-width: 1000px) is true because it “pretends” that the scrollbar isn’t there. And indeed, if we were to hide the scrollbar, the viewport width would grow to 1,000 pixels (983 + 17 = 1000).

@media (min-width: 1000px) {
/* 
  This does *not* mean that the viewport is
  ”at least 1000px wide”.

  The viewport width could be as low as 983px
  under normal circumstances.
*/
}

This behavior is by design. Media queries “assume scrollbars never exist” in order to prevent infinite loops. Web developers should not assume that the entire width of a media query is available on the web page. For example, avoid setting the width of the page to 1000px inside a @media (min-width: 1000px) rule.3

3 Apple does not seem to agree with this reasoning. In Safari, media queries take scrollbars into account, which means that the appearance and disappearance of a classic scrollbar can trigger media query breakpoints, although the browser seems to guard against infinite loops. Nonetheless, Safari’s behavior is considered a bug.

Issue 3: Using 100vw to make an element full width

The length 100vw is equivalent to the width of the layout viewport, except in one case. If the page has a vertical classic scrollbar, 100vw is larger than the viewport width. Due to this anomaly, setting an element to width: 100vw causes the page to overflow horizontally by a small amount in browsers with classic scrollbars.

This is a known issue. The CSS Values and Units module includes the following note:

“Issue: Level 3 assumes scrollbars never existed because it was hard to implement, and only Firefox bothered to do so. This is making authors unhappy. Can we improve here?”

The note is referring to Firefox’s past behavior, where the browser would reduce the size of 100vw on pages that set overflow to scroll on the <html> element. Such pages had a stable scrollbar track, and in that case, 100vw matched the actual viewport width. This behavior was removed from Firefox in 2017, and it was dropped from the CSS specification shortly after. In a recent change of heart, the CSS Working Group decided to revert their earlier decision and reinstate the behavior:

“RESOLVED: If overflow: scroll is set on the root element (not propagated from <body>), account for the default scrollbar width in the size of vw. Also, take scrollbar-gutter […] into account on the root.”

At the time of writing this article, this change has not yet made it into the CSS specification. It will take some time until all the major browsers ship the new behavior.

Solving The Classic Scrollbar Problem

As the title of this article states, the new viewport units did not solve the classic scrollbar problem. The new svw, dvw, and lvw units are equivalent to the original vw unit in browsers (i.e., 100svw = 100dvw = 100lvw = 100vw). At first glance, this may seem like a missed opportunity to solve the classic scrollbar problem with the new viewport units. For example, the length 100dvw could have represented the actual viewport width as it dynamically changes in response to the appearance and disappearance of a vertical classic scrollbar. This would have allowed developers to make any element on the page as wide as the viewport more easily.

There are at least two reasons why the new viewport units did not solve the classic scrollbar problem:

  1. The new viewport units were introduced to solve the problem of 100vh being taller than the initial viewport in mobile browsers. A small mobile viewport due to the browser’s expanded UI is different from a small desktop viewport due to the presence of classic scrollbars on the page, so the same s-prefixed viewport units cannot represent the small viewport in both cases. If they did, then, for example, using 100svh to solve a layout issue in mobile browsers would have potentially unwanted side effects in desktop browsers and vice-versa.
  2. The position of the CSS Working Group is that viewport units should be “resolvable at a computed-value time” and that they should “not depend on layout”. Implementing units that depend on a layout is “relatively hard” for browsers.

The CSS Working Group recently decided to mitigate the classic scrollbar problem by making 100vw smaller in browsers with classic scrollbars when the scrollbar-gutter property is set to stable on the <html> element. The idea is that when the page has a stable scrollbar gutter, the space for the scrollbar is reserved in advance, so the appearance of the scrollbar does not decrease the viewport width. In other words, the viewport has a static width that isn’t affected by the scrollbar. In that case, the length 100vw can safely match the viewport width at all times, whether the scrollbar is present or not. Once this behavior makes it into browsers, developers will be able to use scrollbar-gutter: stable to prevent width: 100vw from horizontally overflowing the page.

/* THIS BEHAVIOR HAS NOT YET SHIPPED IN BROWSERS */

/* On pages with a stable scrollbar gutter */
html {
  scrollbar-gutter: stable;
}

/* 100vw can be safely used */
.full-width {
  width: 100vw;
}
Avoiding The Classic Scrollbar Problem

Since at least 2018, developers have been using CSS custom properties that are dynamically updated via JavaScript to get the actual size of the viewport in CSS. In the following example, the custom property --vw is a dynamic version of the vw unit that is correctly updated when the viewport width changes due to the appearance or disappearance of a vertical classic scrollbar. The CSS variable falls back to 1vw when JavaScript fails to execute or doesn’t load at all.

.full-width {
  width: calc(var(--vw, 1vw) * 100);
}

In the JavaScript code, document.documentElement.clientWidth returns the width of the ICB, which is also the width of the layout viewport. Since the global resize event does not fire when a classic scrollbar changes the viewport width, I’m instead using a resize observer on the <html> element.

new ResizeObserver(() => {
  let vw = document.documentElement.clientWidth / 100;
  document.documentElement.style.setProperty('--vw', `${vw}px`);
}).observe(document.documentElement);

With the introduction of CSS container queries to browsers over the past year, another solution that doesn’t require JavaScript became available. By turning the <body> element into an inline-size query container, the length 100cqw — which is the width of <body> in this case — can be used instead of 100vw to get the desired result. Unlike 100vw, 100cqw becomes smaller when a vertical classic scrollbar appears on the page.

body {
  margin: 0;
  container-type: inline-size;
}

.full-width {
  width: 100vw; /* fallback for older browsers */
  width: 100cqw;
}

Container queries have been supported in all desktop browsers since February 2023. If the page has additional nested query containers, the <body> element’s width (100cqw) can be stored in a registered custom property to make it available inside those query containers. Registered custom properties are not supported in Firefox at the time of writing this article.

Conclusion

If you’d like to learn more about the concepts discussed in this article, I recommend the viewport investigation project, which was a collaboration between browser vendors to “research and improve the state of interoperability of existing viewport measurement features.” The new viewport units were, in fact, one of the focus areas of Interop 2022.