Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8756925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:11:09+00:00 2026-06-13T14:11:09+00:00

Is it possible to create a circle using only HTML5 / CSS3 which has

  • 0

Is it possible to create a circle using only HTML5 / CSS3 which has a border that only goes part way around the circle? If not, what techniques can I use to accomplish this effect? I would prefer to use pure DOM elements, but if I have to I can draw on canvas or spin up an SVG.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T14:11:10+00:00Added an answer on June 13, 2026 at 2:11 pm

    2023 solution

    This method requires no JS, no extra element and not even any pseudos, just a handful of CSS declarations. It also works if the element has a (semi)transparent background in addition to this partial border.

    It uses a two layer mask, one being a conic-gradient which creates a visible pie selection and whose size is relative to the border-box and the second being a simple full cover layer restricted to the padding-box.

    First, we make our element circular (arbitrary width, an aspect-ratio of 1 and a border-radius set to 50%) and give it a border.

    Then, we set a mask that’s a conic-gradient(), relative to the border-box, covering a percentage --p of our element (by default starting from 12 o’clock and going clockwise).

    On top of this mask layer, we set a full cover one restricted to the padding-box.

    .circular-progress {
      border: solid 1.5em hotpink;
      width: 50vmin;
      aspect-ratio: 1;
      border-radius: 50%;
      background: hsla(180, 100%, 50%, .5);
      --mask: 
        linear-gradient(red, red) padding-box, 
        conic-gradient(red var(--p, 17%), transparent 0%) border-box;
      -webkit-mask: var(--mask);
              mask: var(--mask)
    }
    
    /* just to make it obvious it works with semitrasparent background */
    body {
      background: 
        url(https://images.unsplash.com/photo-1693483923875-cdd9ef4a8046?w=800) 
          50%/ cover
    }
    <div class='circular-progress'></div>

    If we want to animate this, we need to also register --p.

    @property --p {
      syntax: '<percentage>';
      initial-value: 0%;
      inherits: true
    }
    
    .circular-progress {
      border: solid 1.5em hotpink;
      width: 50vmin;
      aspect-ratio: 1;
      border-radius: 50%;
      background: hsla(180, 100%, 50%, .5);
      --mask: 
        linear-gradient(red, red) padding-box, 
        conic-gradient(red var(--p), transparent 0%) border-box;
      -webkit-mask: var(--mask);
              mask: var(--mask);
      animation: p 4s linear infinite
    }
    
    @keyframes p { to { --p: 100% } }
    
    /* just to make it obvious it works with semitrasparent background */
    body {
      background: 
        url(https://images.unsplash.com/photo-1693483923875-cdd9ef4a8046?w=800) 
          50%/ cover
    }
    <div class='circular-progress'></div>

    Registering custom properties this way in order to animate them is supported in Chromium browsers and in Safari and it’s coming soonish in Firefox Nightly too.


    Original answer from 2012 (preserved for web history reasons)

    Yes, it is possible – see this:

    .circle {
      position: relative;
      margin: 7em auto;
      width: 16em;
      height: 16em;
      border-radius: 50%;
      background: lightblue;
    }
    
    .arc {
      overflow: hidden;
      position: absolute;
      /* make sure top & left values are - the width of the border */
      /* the bottom right corner is the centre of the parent circle */
      top: -1em;
      right: 50%;
      bottom: 50%;
      left: -1em;
      /* the transform origin is the bottom right corner */
      transform-origin: 100% 100%;
      /* rotate by any angle */
      /* the skew angle is 90deg - the angle you want for the arc */
      transform: rotate(45deg) skewX(30deg);
    }
    
    .arc:before {
      box-sizing: border-box;
      display: block;
      border: solid 1em navy;
      width: 200%;
      height: 200%;
      border-radius: 50%;
      transform: skewX(-30deg);
      content: '';
    }
    <div class='circle'>
      <div class='arc'></div>
    </div>
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When creating circles using D3, is it possible to create a group such that
Is possible create something like this without using ActionBar? I just need button which
I need to create a range-graded circle proportional map, i.e., a map that has
Possible Duplicate: Create an Array of the Last 30 Days Using PHP I am
I want to create a circle that is sectioned into 4 quarters, and each
Is possible create (register) a new class in runtime using delphi. I have a
I have a created a 3 circle venn diagram using pure CSS3 and each
is it possible to get or create a wheel of selectable options, which scrolls
Is this possible: to create DIVs around of current DIV? For example, some DIV
Is possible create an extension for SQL Management Studio in Visual Studio 2010? Visual

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.