• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
rahmanzeb.com

rahmanzeb.com

Rahman Zeb's Portfolio & Blog

  • Home
  • About
  • Tutorials
    • Google Sites Tutorials
    • WordPress Tutorials
    • CSS Tutorials
  • Templates
    • Google Sites Templates
  • Portfolio
  • Hire me!
  • Contacts

How to create a ZigZag backgound in CSS

19/03/2021 By Rahman Zeb Leave a Comment

If you are looking for how to create a zigzag background in CSS (Cascading Stylesheets) without using any image/images then the following tutorial is for you. We’ll use CSS Gradients to create a zigzag background.

CSS ZigZag Background Demo

CSS ZigZag Background

CSS ZigZag Background Demo Code

<style>
.zigzag-bg h3 {
    font-size: 30px;
    background: rgb(241 241 241 / 60%);
    padding: 10px;
}
.zigzag-bg {
    text-align: center;
    display: flex;
    aling-items: center;
    justify-content: center;
    padding: 150px;
    background: linear-gradient(45deg, green 25%, transparent 25%), 
    linear-gradient(-45deg, green 25%, transparent 25%), 
    linear-gradient(135deg, green 25%, transparent 25%) 15px 0, 
    linear-gradient(-135deg, green 25%, transparent 25%) 15px 0;
    background-size: 30px 30px;
}
</style>

<div class="zigzag-bg">
    <h3>CSS ZigZag Background</h3>
</div>

In the code mentioned above we used linear-gradient to achieve the zigzag background effect without using any images. We simply used linear-gradient as a background to achieve the zigzag background effect. Just play with and if you have any problems kindly ask me in the comments below and I’ll do my best to make things work for you.

Share this:

  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on X (Opens in new window) X
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on LinkedIn (Opens in new window) LinkedIn

Filed Under: CSS Tutorials Tagged With: CSS

About Rahman Zeb

Rahman Zeb is a passionate freelance web designer and developer and loves creating awesome and interactive websites. Beside Web design and development he loves to play cricket and badminton with his friends.

Reader Interactions

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Hire Me

zebkhan
Fiverr
Seller
I'm web designer and developer and an expert in languages like html, css, javascript, php & mysql. I also know Joomla & Wordpress and have designed and developed dozens of sites. Most of the sites I have designed were responsive.

Follow Me

  • Facebook
  • X
  • Google
  • LinkedIn
  • Pinterest

Top Posts & Pages

  • How to add click to Call button in google sites
    How to add click to Call button in google sites
  • Google Sites Templates
    Google Sites Templates
  • Make an image scroll from top to bottom on hover
    Make an image scroll from top to bottom on hover
  • How to add typing text effect in Google Sites
    How to add typing text effect in Google Sites

Main Menu

  • Home
  • About
  • Tutorials
    • Google Sites Tutorials
    • WordPress Tutorials
    • CSS Tutorials
  • Templates
    • Google Sites Templates
  • Portfolio
  • Hire me!
  • Contacts

Footer

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 239 other subscribers

Recent Posts

  • How to add typing text effect in Google Sites
  • Top 3 Custom Forms you can use in Google sites instead of google forms for free
  • Add click to chat on WhatsApp & facebook buttons or links in google sites
  • How to add video background in Google Sites
  • Make an image scroll from top to bottom on hover

Best Web Hosting

BlueHost SiteGround iPage Godaddy

Created with Genesis Framework on Wordpress and hosted by BlueHost

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT