Amazon EC2 Deep Dive: Optimizing Workloads With Hardware Insights

Amazon Elastic Compute Cloud (EC2) stands as a cornerstone of AWS's suite of cloud services, providing a versatile platform for computing on demand. Yet, the true power of EC2 lies in its diverse array of instance types, each meticulously crafted to cater to distinct computational requirements, underpinned by a variety of specialized hardware architectures. This article goes into detail, exploring the intricacies of these instance types and dissecting the hardware that drives them. Through this foundational approach, we aim to furnish a more profound comprehension of EC2's ecosystem, equipping you with the insights necessary to make the right decisions when selecting the most apt instance for your specific use case.

Why Understand the Hardware Beneath the Instances?

When diving into cloud computing, it's tempting to view resources like EC2 instances as abstracted boxes, merely serving our applications without much thought to their inner workings. However, having a fundamental understanding of the underlying hardware of your chosen EC2 instance is crucial. This knowledge not only empowers you to make more informed decisions, optimizing both performance and costs, but also ensures your applications run smoothly, minimizing unexpected disruptions. Just as a chef selects the right tools for a dish or a mechanic chooses the correct parts for a repair, knowing the hardware components of your EC2 instances can be the key to unlocking their full potential. In this article, we'll demystify the hardware behind the EC2 curtains, helping you bridge the gap between abstract cloud resources and tangible hardware performance.

Apply Strangler Pattern To Decompose Legacy System Into Microservices: Part 1

Many sources provide explanations of microservices in a general context, but there is a lack of domain-specific examples. Newcomers or those unsure of where to begin may find it challenging to grasp how to transition their legacy systems into a microservices architecture. This guide is primarily intended for individuals who are struggling to initiate their migration efforts, and it offers business-specific examples to aid in understanding the process.

There is another pattern I wanted to talk about - the Strangler Pattern - which is a migration pattern used to transition from a legacy system to a new system incrementally while minimizing risk.

Analyzing the Various Components of TCO for Digital Products

Are you ready to unravel the hidden costs of digital products? Buckle up and join us on a journey through the intricate world of Total Cost of Ownership (TCO). In today's fast-paced digital landscape, understanding the expenses involved in developing, deploying, and maintaining a digital product is crucial for businesses and individuals. 

From hardware and software investments to ongoing maintenance and upgrades, every component contributes to the grand TCO puzzle. In this article, we'll delve deep into each aspect, providing you with invaluable insights and eye-opening revelations.  

Advanced Content Prioritization Techniques for Web Developers

Creating performant and responsive websites is a top priority for web developers. One way to achieve this is through content prioritization, which involves loading critical content before non-critical content. In this article, we will explore advanced techniques and tools that can help web developers optimize their projects using content prioritization.

Advanced Content Prioritization Techniques and Tools

Extracting Critical CSS With PurgeCSS and Critical

Extract only the necessary CSS rules required to render above-the-fold content using PurgeCSS (https://purgecss.com/) and Critical (https://github.com/addyosmani/critical). PurgeCSS removes unused CSS, while Critical extracts and inlines the critical CSS, improving the rendering of critical content.

Integrate Alexa With Voiceflow

Alexa has a lot of capabilities, but it is not easy to create a complex conversation. Voiceflow is a tool that allows you to create complex conversations with Alexa without writing code. This integration allows you to create a conversation in Voiceflow and then deploy it to Alexa.

Because of that, In this repository, you will find a simple example of how to integrate Alexa with Voiceflow using the Alexa Skills Kit SDK for Node.js and calling Voiceflow’s Dialog Manager API.

Writing An Efficient Software Design Document

Software design plays a vital role in the life of a software engineer. It begins with a problem statement and sets the path for implementing a solution. In this article, I’ll be talking about a typical process that I follow to thoroughly understand a problem and successfully deliver a solution.

Problem Statement

Defining a problem statement is the very first and crucial phase of the development process. These comes from product, leadership, or another engineers. A well defined problem provides a very clear picture of how the system should look like. But often, How well a problem statement is defined, there are a lot of ambiguities and unknowns. To overcome these, we proceed to requirement gathering.

How to Convert WooCommerce Visitors into Customers (9 Tips)

Do you want to convert visitors to your WooCommerce store into customers?

Bringing traffic to your WooCommerce store is only half the battle. The other half is to convert those visitors into paying customers. One of the ways you can optimize your online store is by using targeted messages and offering incentives to boost conversions.

In this article, we will show you how to easily convert WooCommerce visitors into customers.

How to convert WooCommerce visitors into customers

Why Do You Need Conversion Optimization for Your WooCommerce Store?

Most eCommerce stores rely on search engines or paid advertising campaigns for traffic.

There are many other ways to get more traffic to your website. However, more than 75% of visitors who find your website through search engines will never find it again. Of the people who stick around, only a small percentage of them will add products to their carts.

In the end, more than 69% of shopping carts are abandoned without making a purchase. Shipping costs, a complicated checkout experience, and bad design are among the top reasons for abandoned carts.

Considering these statistics, your WooCommerce store will continue losing potential sales if you don’t work on converting those visitors into customers.

How Do You Convert Visitors Into Customers?

The process and technique that is used to convert visitors into customers is called conversion rate optimization (CRO). Marketers and usability experts use CRO to successfully drive visitors to become customers.

Basically, you remove obstacles that affect a user’s experience on your WordPress website. You also provide incentives that convince users to buy.

Lastly, if a user must leave without making a purchase, then your goal is to try and get their information through lead generation. This allows you to communicate with them via email and offer personalized messages, special discounts, or new product announcements.

In the early days of eCommerce, you needed programming skills to work on all these tasks, but not anymore. Now, you have tools that make it extremely easy to do all these things without writing code or acquiring any new technical skills.

That being said, let’s take a look at different ways you can convert WooCommerce visitors into customers.

1. Offer Discount Coupons and Free Shipping

One of the easiest ways of converting visitors into customers is by offering incentives like discounts and free shipping.

They also help convert abandoning visitors and reduce abandoned carts. For instance, if a visitor is about to exit your online store without checking out, then you can show a popup with a discount coupon.

WooCommerce popup preview

The best way to show discounts, flash sales, free shipping, and other offers is by using OptinMonster. It is the best conversion optimization and lead generation software.

OptinMonster lets you create different campaigns for your WooCommerce store, including popups, slide-in scroll boxes, floating bars, countdown timers, sidebar forms, and in-line forms.

Besides that, it offers powerful display rules to show the campaign to the right person at the right time.

Ecommerce display rules

For instance, it allows eCommerce targeting, where you can show your campaigns based on cart total, specific product pages, how long a customer has spent in your online store, and more.

For more details, see our guide on how to create a WooCommerce popup to increase sales.

You can also create a spin-to-win campaign to offer discount coupons and free shipping to users. This helps create engagement and is a fun way to boost conversions.

OptinMonster Spin Wheel Campaign

2. Promote Products That Your Audience Prefers

Another way to get more conversions in your WooCommerce store is by figuring out which products your audience likes the most and then promoting them. This way, you can improve the visibility of top-selling products and boost conversions.

To find out which products your visitors prefer, you can use MonsterInsights. It is the best Google Analytics plugin for WordPress that helps you set up advanced tracking without editing code.

MonsterInsights lets you set up eCommerce tracking, which helps record conversions, revenue, and user behavior in your WooCommerce store. It also offers eCommerce reports, so you can easily view top products inside your WordPress dashboard.

How to set up eCommerce tracking on a WooCommerce store

Once you know which products your audience prefers, the next step is to promote them in your WooCommerce store.

A simple way to do that is by improving their visibility so users can easily find and purchase them. For example, you can show top-selling products under other items, in the sidebar, or within your content.

Showing best-selling products on your WooCommerce store using MonsterInsights

With MonsterInsights, you can easily show top products across your website. It offers a Popular Products feature that lets you add products at the end of a blog post to boost conversions.

To learn more, please see our guide on how to display popular products on WooCommerce product pages.

3. Make High-Converting Sales Pages

You can also create high-converting sales pages to promote different products and boost conversions in your WooCommerce store.

A sales page has a single purpose, which is to get people to buy your products or services. A high-converting sales page will have clear call-to-action (CTA) buttons, engaging product images, and other details to help users buy the product.

You can easily create high-converting sales pages for WooCommerce using SeedProd. It is the best WordPress page builder that lets you create custom landing pages without editing code.

SeedProd's drag and drop page builder

SeedProd offers 300+ prebuilt templates, multiple customization options, a drag-and-drop page builder, and more. It also integrates with email marketing tools and other third-party tools.

For step-by-step details, see our guide on how to create a sales page in WordPress that converts.

4. Build an Email List and Promote Products

Did you know that email lists get 10 times higher conversions than social media campaigns?

Building an email list for your WooCommerce store can help improve your revenue. You can tell your subscribers about the latest products, promotional sales, upcoming campaigns, and more.

Example of a flash sale email blast

You can also send targeted emails to specific subscribers. For example, if you are launching a new product in a specific location, then you can send out an email campaign for subscribers from that particular country.

To get started, you will need an email marketing tool like Constant Contact. It is very easy to use, and you can easily collect email addresses, manage them, and segment them into different groups. Plus, it helps you set up automated drip notifications and other email campaigns.

Create an automated workflow

Once you’ve started collecting emails, you can take things one step further and try different ways to grow your email list.

For example, you can offer discounts, giveaways, and other incentives to customers in exchange for their email. You can see our complete guide to uncover more ways to grow your email list.

5. Leverage Social Proof to Boost Conversions

Another simple hack for converting WooCommerce visitors into customers is by showing social proof.

People feel more comfortable with their buying decisions when they know others have also bought the same product and had a great experience.

There are different ways to show social proof on your WooCommerce store. For instance, you can use TrustPulse to display real-time user activity notifications, such as the latest product purchase.

A notification, created using TrustPulse

Besides that, you can also show testimonials and customer reviews on the product page to boost social proof.

They can help you gain trust from your visitors and encourage them to purchase the product.

Preview for testimonials

You can learn more by following our guide on how to add a customer reviews page in WordPress.

Another way to boost conversions in WooCommerce stores is by using FOMO or fear of missing out. You can add a countdown timer to a discount campaign and encourage users to make a purchase before time runs out.

Black Friday FOMO popup for WooCommerce

6. Run a Giveaway Contest

If you are looking for a way to boost engagement on your website and increase eCommerce conversions, then running a viral giveaway contest is a great way of doing it.

A competition gives your WooCommerce visitors a fun reason to return to your store and stand a chance to win free products.

In return, you can ask users to participate in the competition by following your social media pages, signing up for an email newsletter, inviting a friend to participate, and more.

This way, you’ll also grow your social followers, increase your email list, promote your brand, and build a relationship with your audience.

The best way to run a giveaway contest is by using RafflePress. It is the best giveaway plugin for WordPress that’s easy to use. RafflePress offers a drag-and-drop contest builder with lots of customization options.

Host a giveaway

To learn more, please see our guide on how to create a WooCommerce contest to boost loyalty and engagement.

7. Upsell Products in WooCommerce

Upselling is a technique that encourages visitors to purchase a higher-priced product instead of the one they already have in their shopping cart.

These products might have a higher value, offer more features, or have better quality. As a result, they are also more expensive and more lucrative for your business.

For instance, let’s say you are selling plugins or software in your online store. You can offer users a higher pricing plan with more addons and upgrades than the base plan.

There are several ways you can upsell products in WooCommerce. First, you can show different products on a product page at the bottom and ask visitors to buy them instead. Or you can create a popup to upsell particular products.

Upsell popup preview

Besides that, you can also showcase different products on the checkout page before a user makes a purchase. Or you might promote products on the thank you page, enticing a customer to buy more items.

To learn more details about each of these methods, please see our guide on how to upsell products in WooCommerce.

8. Add Express Checkout Buttons

Another simple method for boosting conversions in your WooCommerce store is offering express checkout buttons. This allows users to skip different steps in the checkout process and go directly to the payment page.

This provides a better shopping experience for customers and makes the buying process quicker. A user can simply click a button to make a purchase. As a result, you’ll see more conversions and less cart abandonment.

Express checkout buttons preview

Please see our guide on how to add express checkout buttons in WooCommore to learn more.

9. Offer a Personalized Experience to Users

Personalization helps you improve the user experience by making your content more personal for each visitor. You can create product offerings for different users to boost WooCommerce conversions.

For example, you might greet logged-in customers with their names, show them products based on their browsing history, and offer them discounts or coupons.

Lightbox popup with yes no optin

For more details, you can see our guide on how to show personalized content to different users in WordPress.

We hope this article helped you learn how to convert WooCommerce visitors into customers. You may also want to see our guide on how to enable customer tracking in WooCommerce with Google Analytics and our expert picks for the must-have WordPress plugins for business websites.

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 How to Convert WooCommerce Visitors into Customers (9 Tips) first appeared on WPBeginner.

6 Best WordPress Theme Builders for 2024 (Compared)

Are you looking for a theme builder for your WordPress site?

With a theme builder, you can customize every part of your website without having to learn and use any code. These builders are super flexible and can help you create a unique theme that matches your branding and style.

In this article, we will share our list of the best WordPress theme builders that you can use to customize your website.

Best WordPress theme builders

Why Use a Theme Builder in WordPress?

If you have a WordPress website, then using a theme builder gives you more creative freedom over your website. It allows you to create a design that perfectly matches your niche and brand.

Most theme builders come with premade templates that let you easily create a header, home page, footer, blog page, and contact us page for your blog with just a few clicks.

For example, if you run a furniture store, then you can easily use a theme builder’s premade template to launch your business website in a few minutes.

Furniture store template

Using theme builders is also super cost-effective and saves you a lot of time, as you won’t have to spend hours coding your theme.

Plus, these tools are often beginner-friendly and come with a drag-and-drop builder, letting you create responsive and unique themes for your website.

Note: You may confuse a theme builder with page builders, but they are quite different. A theme builder lets you customize your whole website, including headers, footers, and different pages.

By contrast, a page builder only lets you customize and create a single page at a time. For details, you can see our glossary article for what a page builder is.

Having said that, here is our list of the best WordPress theme builders on the market.

1. SeedProd

SeedProd

SeedProd is the best WordPress theme builder on the market. It comes with hundreds of premade templates, an easy-to-use drag-and-drop builder, and 90+ pro blocks.

The tool allows you to launch a unique theme for any niche, like a fashion blog, in just a few minutes using its premade designs. You can then easily edit the home page, archive, header, footer, single post, single page, archive, sidebar, and more.

Plus, the tool also offers advanced blocks for WooCommerce and Easy Digital Downloads, making it a great choice if you have an online store.

SeedProd theme builder

Other than that, SeedProd can integrate with popular email marketing services like Constant Contact or Brevo to help you build an email list or generate leads.

The WordPress plugin also lets you add animations, custom scripts, controls access, and even lets you do domain mapping, making it the ultimate choice.

For more details, you can see our tutorial on how to create a custom theme in WordPress.

Pros

  • SeedProd also allows you to design single landing pages for your website. For more information, you can see our tutorial on how to create a landing page in WordPress.
  • It has a free version.
  • Its layout navigation feature can easily rearrange sections, rows, columns, and blocks.
  • It has over 20 color schemes, font combinations, shape dividers, smart sections, and bloat-free code to decrease your website load time.
  • With SeedProd, you can add dynamic content to your website.
  • It allows you to create a maintenance, coming soon, or login page for your website easily.

Cons

  • To unlock some of its advanced features, you will have to buy the premium plan.

Why we recommend using SeedProd: SeedProd is the best theme builder on the market. It comes with 300+ templates specifically designed for unique niches, an easy-to-use interface, and third-party tool integrations. SeedProd is also a great option if you have an online store due to its integrations with WooCommerce and EDD and advanced blocks created specifically for these plugins.

For more details, you can see our complete SeedProd review.

2. Thrive Theme Builder

Thrive Theme Builder

Thrive Theme Builder is a popular drag-and-drop plugin that allows you to create custom and fully mobile-responsive themes for your website without having to learn any code.

It is part of the Thrive Suite and comes with a library of prebuilt templates that you can use to easily build custom pages, headers, and footers for your theme.

Plus, the tool offers 100+ design elements, including icons, fonts, fancy dividers, page blocks, content elements, conversion tools, and global color management.

Pros

Cons

  • Thrive Theme Builder does not have a free version.
  • It has a limited number of premade templates compared to other tools on this list.

Why we recommend using Thrive Theme Builder: If you have a WordPress blog and want to build your email list, then we recommend using the Thrive Theme Builder. The plugin offers a number of conversion-focused tools that can help you capture your users’ email addresses.

3. Divi Theme Builder

Divi Theme builder

Divi is one of the most popular WordPress themes on the market. It comes with a theme builder and 800+ site templates that you can use to customize your website according to your niche.

The Divi builder is super beginner-friendly and comes with a drag-and-drop interface, WooCommerce integration, and responsive designs that help optimize your website speed.

It even offers built-in SEO features that can help your website rank higher and get more traffic.

Pros

  • Divi offers a huge range of customizable elements, including text modules, image modules, modules for displaying social media feeds, pricing tables, and more.
  • It lets you nest different layouts within other templates to create layered designs.
  • It supports dynamic content and allows you to create conditional templates for your theme.

Cons

  • Divi does not allow you to directly add custom CSS code for theme customization.
  • It has caused performance issues for some websites. This is because Divi is a heavier theme builder compared to some other plugins.

Why we recommend using Divi Theme Builder: Overall, Divi is a great theme builder if you have a small business site. The tool has about 800 premade templates for different niches, and you can use it to launch your business site easily. Plus, Divi is super affordable, making it a cost-effective solution.

4. Beaver Builder

Beaver Builder

Beaver Builder is a well-known page builder plugin that allows you to customize landing pages for your website. You can install the plugin’s Themer addon and use the same visual drag-and-drop editor to customize entire themes.

It is a super developer-friendly tool that enables you to create custom headers, footers, archives, blog pages, and home pages. Plus, you can add dynamic data through the plugin’s field connectors.

Pros

  • It comes with custom WooCommerce layouts like WooCommerce Shop, Checkout, Cart, and My Account pages.
  • It has 30+ design modules.
  • Beaver Builder offers dynamic content support.

Cons

  • It does not have a free version, and its paid plans can be expensive for some users.
  • It has a bit of a learning curve and can be difficult to use for beginners.

Why we recommend using Beaver Builder: If you want to create a simple theme for your blog, then we recommend using Beaver Builder. Its visual interface and various premade modules can help you launch a blog and customize its appearance in no time.

5. Brizy

Brizy website

Brizy is a great website builder that offers a drag-and-drop interface, front-end editing, and a library of premade templates to help you build a custom theme without using any code.

It lets you create responsive designs, integrates with email marketing services, and has a variety of customizable options, including text and image modules.

Plus, Brizy even comes with a display conditions feature that lets you control where and when certain elements of your website appear. This can be useful if you want to hide certain content from users who are not logged in or display different content based on the user’s location.

Pros

  • Brizy has 36+ elements, offers a free plan, comes with a mega menu feature for your navigation menu, and even lets you view your theme editing history.
  • If you run multiple WordPress sites, then the tool allows you to sync content between them easily.
  • It comes with a ‘Global Blocks’ feature that lets you add the same headers and footers to different pages of your website.

Cons

  • It offers limited third-party tool integrations.
  • Brizy’s library of templates is not as comprehensive as some of the other tools.

Why we recommend using Brizy: Overall, Brizy is an excellent theme builder. We recommend this tool if you have multiple WordPress sites and want to sync them to share popups, blocks, or whole pages between them.

6. Elementor

Elementor website

Elementor is a popular WordPress theme builder that comes with many different premade templates, customizable elements, and the global styles feature that can apply to all the pages on your website.

It has a drag-and-drop interface, a huge community, and is super lightweight, helping your website’s speed and performance.

With Elementor, you can create mobile-responsive themes, add nested layouts, and even use dynamic tags to add personalized content to your website.

Pros

  • Elementor comes with a WooCommerce builder that lets you customize the layout of your online store.
  • It also has a popup builder, form builder, and loop builder that you can use.
  • The tool allows you to set conditions for when to display certain elements on your website.

Cons

  • Elementor does not have undo/redo options for theme customization.
  • It gives you limited control over the code on your website.
  • It can be a bit difficult to navigate for beginners.

Why we recommend using Elementor: Overall, Elementor is a good choice if you have an online store because it comes with a WooCommerce builder and premade templates, along with a huge community of users.

Which Is the Best Theme Builder for WordPress?

In our expert opinion, SeedProd is the best WordPress theme builder on the market because it comes with 300+ premade templates for specific niches, integrations with email marketing services, dynamic content, and over 20 color schemes. Plus, the tool also offers a free version.

However, if you have a WordPress blog and want to build an email list, then Thrive Theme Builder is a good choice because it offers different conversion-focused features.

Similarly, if you own a small business, then Divi is also a great option because it has about 800 templates for different niches.

You can also opt for Brizy if you have multiple WordPress sites or use Elementor if you run an online store.

Frequently Asked Questions About WordPress Theme Builders

Here is a list of some of the frequently asked questions from our readers about theme builders.

Why use a theme builder instead of a theme in WordPress?

There are many great WordPress themes that you can use on your website. However, by opting for a theme builder, you get more control over your design and can see all your changes with a live preview feature.

Plus, theme builders are more flexible, allowing you to create different custom designs for all your pages without having to learn and write any code.

Which is the best free theme builder for WordPress?

The average cost for theme builders is about $49 per year for a single-site license, and up to $249 per year for a multi-site license.

However, if you are looking for a free solution that lets you create custom themes, then we recommend SeedProd’s free plan as it has most of the features required to customize a whole theme for your website.

What factors should I consider when picking a theme builder?

When choosing a theme builder, you should consider factors like ease of use, customization elements, impact on website speed, integrations, pricing, and customer support. All of these elements will help you pick the best theme builder for your website.

Best WordPress Guides to Help Design Your Website

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 6 Best WordPress Theme Builders for 2024 (Compared) first appeared on WPBeginner.

CSS Responsive Multi-Line Ribbon Shapes (Part 2)

In my previous article, we tackled ribbons in CSS. The idea was to create a classic ribbon pattern using a single element and values that allow it to adapt to however much content it contains. We established a shape with repeating CSS gradients and tailor-cut the ribbon’s ends with clip-path() to complete the pattern, then used it and wound up with two ribbon variations: one that stacks vertically with straight strands of ribbons and another that tweaks the shape by introducing pseudo-elements.

If you are wondering why I am using 80%, then there is no particular logic to my approach. It’s because I found that covering more space with the color and leaving less space between lines produces a better result for my eye. I could have assigned variables to control the space without touching the core code, but there’s already more than enough complexity going on. So, that’s the reasoning behind the hard-coded value.

Styling The First Ribbon

We’ll start with the red ribbon from the demo. This is what we’re attempting to create:

It may look complex, but we will break it down into a combination of basic shapes.

Stacking Gradients

Let’s start with the gradient configuration, and below is the result we are aiming for. I am adding a bit of transparency to better see both gradients.

h1 {
  --c: #d81a14;

  padding-inline: .8lh;
  background:
    /* Gradient 1 */
    linear-gradient(var(--c) 80%, #0000 0) 
      0 .1lh / 100% 1lh,
    /* Gradient 2 */
    linear-gradient(90deg, color-mix(in srgb, var(--c), #000 35%) 1.6lh, #0000 0) 
      -.8lh 50% / 100% calc(100% - .3lh) repeat-x;
}

We already know all about the first gradient because we set it up in the last section. The second gradient, however, is placed behind the first one to simulate the folded part. It uses the same color variable as the first gradient, but it’s blended with black (#000) in the color-mix() function to darken it a smidge and create depth in the folds.

The thing with the second gradient is that we do not want it to reach the top and bottom of the element, which is why its height is equal to calc(100% - .3lh).

Note the use of padding in the inline direction, which is required to avoid text running into the ribbon’s folds.

Masking The Folded Parts

Now, it’s time to introduce a CSS mask. If you look closely at the design of the ribbon, you will notice that we are cutting triangular shapes from the sides.

We have applied a triangular shape on the left and right sides of the ribbon. Unlike the backgrounds, they repeat every two lines, giving us the complex repetition we want.

Imagine for a moment that those parts are transparent.

That will give us the final shape! We can do it with masks, but this time, let’s try using conic-gradient(), which is nice because it allows us to create triangular shapes. And since there’s one shape on each side, we’ll use two conical gradients — one for the left and one for the right — and repeat them in the vertical direction.


mask:
  conic-gradient(from 225deg at .9lh, #0000 25%, #000 0) 
    0 1lh / 50% 2lh repeat-y,
  conic-gradient(from 45deg at calc(100% - .9lh), #0000 25%, #000 0) 
    100% 0 / 50% 2lh repeat-y;

Each gradient covers half the width (50%) and takes up two lines of text (2lh). Also, note the 1lh offset of the first gradient, which is what allows us to alternate between the two as the ribbon adapts in size. It’s pretty much a zig-zag pattern and, guess what, I have an article that covers how to create zig-zag shapes with CSS masks. I highly recommend reading that for more context and practice applying masks with conical gradients.

Masking The Ribbon’s Ends

We are almost done! All we are missing are the ribbon’s cut edges. This is what we have so far:

We can fill that in by adding a third gradient to the mask:

mask:
  /* New gradient */
  linear-gradient(45deg, #000 50%, #0000 0) 100% .1lh / .8lh .8lh no-repeat,

  conic-gradient(from 225deg at .9lh, #0000 25%, #000 0) 
   0 1lh / 50% 2lh repeat-y,
  conic-gradient(from 45deg  at calc(100% - .9lh), #0000 25%, #000 0) 
   100% 0 / 50% 2lh repeat-y;

That linear gradient will give us the missing part at the top, but we still need to do the same at the bottom, and here, it’s a bit tricky because, unlike the top part, the bottom is not static. The cutout can be either on the left or the right based on the number of lines of text we’re working with:

We will fill in those missing parts with two more gradients. Below is a demo where I use different colors for the newly added gradients to see exactly what’s happening. Use the resize handle to see how the ribbon adjusts when the number of lines changes.

Styling The Second Ribbon

The second ribbon from the demo — the green one — is a variation of the first ribbon.

I am going a little bit faster this time around. We’re working with many of the same ideas and concepts, but you will see how relatively easy it is to create variations with this approach.

The first thing to do is to add some space on the top and bottom for the cutout part. I’m applying a transparent border for this. The thickness needs to be equal to half the height of one line (.5lh).

h1 {
  --c: #d81a14;

  border-block: .5lh solid #0000;
  padding-inline: 1lh;
  background: linear-gradient(var(--c) 80%, #0000 0) 0 .1lh / 100% 1lh padding-box;
}

Note how the background gradient is set to cover only the padding area using padding-box.

Now, unlike the first ribbon, we are going to add two more gradients for the vertical pieces that create the folded darker areas.

h1 {
  --c: #d81a14;

  border-block: .5lh solid #0000;
  padding-inline: 1lh;
  background:
    /* Gradient 1 */
    linear-gradient(var(--c) 80%, #0000 0) 0 .1lh / 100% 1lh padding-box,
    /* Gradient 2 */
    linear-gradient(#0000 50%, color-mix(in srgb, var(--c), #000 35%) 0) 
     0 0 / .8lh 2lh repeat-y border-box,
    /* Gradient 3 */
    linear-gradient(color-mix(in srgb, var(--c), #000 35%) 50%, #0000 0) 
     100% 0 / .8lh 2lh repeat-y border-box;
}

Notice how the last two gradients are set to cover the entire area with a border-box. The height of each gradient needs to equal two lines of text (2lh), while the width should be consistent with the height of each horizontal gradient. With this, we establish the folded parts of the ribbon and also prepare the code for creating the triangular cuts at the start and end of the ribbon.

Here is an interactive demo where you can resize the container to see how the gradient responds to the number of lines of text.

Applying only the conic gradients will also hide the cutout part, so I have to introduce a third gradient to make sure they remain visible:

mask:
  /* New Gradient */
  linear-gradient(#000 1lh, #0000 0) 0 -.5lh,
  /* Left Side */
  conic-gradient(from 225deg at .9lh, #0000 25%, #000 0) 
   0 1lh / 51% 2lh repeat-y padding-box,
  /* Right Side */
  conic-gradient(from 45deg at calc(100% - .9lh), #0000 25%, #000 0) 
   100% 0 / 51% 2lh repeat-y padding-box;

And the final touch is to use clip-path for the cutouts at the ends of the ribbon.

Notice how the clip-path is cutting two triangular portions from the bottom to make sure the cutout is always visible whether we have an odd or even number of lines.

This is how the final code looks when we put everything together:

h1 {
  --c: #d81a14;

  padding-inline: 1lh;
  border-block: .5lh solid #0000;
  background: 
    linear-gradient(var(--c) 80%, #0000 0)
      0 .1lh / 100% 1lh padding-box,
    linear-gradient(#0000 50%, color-mix(in srgb,var(--c), #000 35%) 0)
      0 0 / .8lh 2lh repeat-y border-box,
    linear-gradient(color-mix(in srgb, var(--c), #000 35%) 50%, #0000 0)
      100% 0 / .8lh 2lh repeat-y border-box;
  mask:
    linear-gradient(#000 1lh, #0000 0) 0 -.5lh,
    conic-gradient(from 225deg at .9lh,#0000 25%,#000 0)
     0 1lh/51% 2lh repeat-y padding-box,
    conic-gradient(from 45deg at calc(100% - .9lh), #0000 25%, #000 0)
     100% 0 / 51% 2lh repeat-y padding-box;
  clip-path: polygon(0 0, calc(100% - .8lh) 0,
    calc(100% - .4lh) .3lh,
    100% 0, 100% 100%,
    calc(100% - .4lh) calc(100% - .3lh),
    calc(100% - .8lh) 100%, .8lh 100%, .4lh calc(100% - .3lh), 0 100%);
}

I challenged you to find a way to reverse the direction of the first ribbon by adjusting the gradient values. Try to do the same thing here!

It may sound difficult. If you need a lifeline, you can get the code from my online collection, but it’s the perfect exercise to understand what we are doing. Explaining things is good, but nothing beats practicing.

The Final Demo

Here is the demo once again to see how everything comes together.

See the Pen Responsive multi-line ribbon shapes by Temani Afif.

Wrapping Up

There we go, two more ribbons that build off of the ones we created together in the first article of this brief two-part series. If there’s only one thing you take away from these articles, I hope it’s that modern CSS provides us with powerful tools that offer different, more robust approaches to things we used to do a long time ago. Ribbons are an excellent example of a long-living design pattern that’s been around long enough to demonstrate how creating them has evolved over time as new CSS features are released.

I can tell you that the two ribbons we created in this article are perhaps the most difficult shapes in my collection of ribbon shapes. But if you can wrap your head around the use of gradients — not only for backgrounds but masks and clipping paths as well — you’ll find that you can create every other ribbon in the collection without looking at my code. It’s getting over that initial hurdle that makes this sort of thing challenging.

You now have the tools to make your own ribbon patterns, too, so why not give it a try? If you do, please share them in the comments so I can see your work!

Further Reading On SmashingMag

Top Premium WordPress Plugins & Themes

Design and functionality are essential aspects of any successful website. And with the abundance of WordPress themes and plugins available, you have the power to elevate your site to new heights. In this article, we will explore the latest and most effective WordPress themes and plugins to help you enhance your website’s appearance and performance. […]