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

  • Home
  • SEARCH
  • 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 9200441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:46:08+00:00 2026-06-17T22:46:08+00:00

I have built a bordered and striped oval in CSS, and I would like

  • 0

I have built a bordered and striped oval in CSS, and I would like to do something similar with SVG. I’m completely new to SVG, and I’ve tried using Raphael. This is as far as I got (see fiddle here):

var paper = Raphael(150, 150, 320, 320);
var oval = paper.rect(0, 0, 100, 50, 25);
oval.attr('fill', 'crimson');
oval.attr('stroke', 'transparent');

How can I do stripes with SVG, in a similar vein to the CSS?

  • 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-17T22:46:10+00:00Added an answer on June 17, 2026 at 10:46 pm

    Raphael doesn’t appear to support patterns but it does support linear gradients as a value for the fill attribute:

    Gradients

    “‹angle›-‹colour›[-‹colour›[:‹offset›]]*-‹colour›”, example:
    “90-#fff-#000” – 90° gradient from white to black or
    “0-#fff-#f00:20-#000” – 0° gradient from white via red (at 20%) to
    black.

    So using the linear gradient format described in the Raphael documentation, we could create a striped gradient. It would probably make sense to create a function that generates the striped gradient string for you.

    function gradientString(color1, color2, step) {
        var gradient = '0-' + color1,
            stripe = false,
            i;
    
        for (i = 0; i < 100; i += step) {
            if (stripe) {
                gradient += '-' + color1 + ':' + i + '-' + color2 + ':' + i;
            } else {
                gradient += '-' + color2 + ':' + i + '-' + color1 + ':' + i;
            }
    
            stripe = !stripe;
        }
    
        return gradient;
    }
    
    var paper = Raphael(150, 150, 320, 320);
    var oval = paper.rect(0, 0, 100, 50, 25);
    oval.attr('fill', gradientString('white', 'crimson', 2));
    oval.attr('stroke', 'crimson');
    

    See: http://jsfiddle.net/p4Qgw/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built a WinRT app. When i run it using Debug, i would
I have built an internal library for my team and would like them to
I have a large scroll-able table I built with Twitter bootstrap but would like
I have built a basic theme for my Flex app. I would like to
I have built an application in C# that I would like to be optimized
I have built a local DVD Database using Codeigniter, With film names etc in.
I have built a mock object using EasyMock, and I'm trying to have the
I have built a site using php and want to try keep it one
I have built ICS source using make -j4, then I have modified the Music
I have built a website using php, jquery and mysql.it is running on the

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.