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 6571879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:56:13+00:00 2026-05-25T14:56:13+00:00

I was trying to make rounded corners for s svg:image (image embedded in SVG)

  • 0

I was trying to make rounded corners for s svg:image (image embedded in SVG) with d3.js. I can’t find out how to properly style the image, because according to W3C spec I should be able to use CSS, but neighter border nor rounded edges work for me.

Thanks in advance.

  vis.append("svg:image")
     .attr("width", width/3)
     .attr("height", height-10)
     .attr("y", 5)
     .attr("x", 5)      
     .attr("style", "border:1px solid black;border-radius: 15px;")
     .attr("xlink:href",
           "http://www.acuteaday.com/blog/wp-content/uploads/2011/03/koala-australia-big.jpg"); 

Edit:

Browsers tested: Firefox, Chrome

  • 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-05-25T14:56:14+00:00Added an answer on May 25, 2026 at 2:56 pm

    ‘border-radius’ doesn’t apply to svg:image elements (yet anyway). A workaround would be to create a rect with rounded corners, and use a clip-path.

    An example.

    The relevant part of the source:

    <defs>
        <rect id="rect" x="25%" y="25%" width="50%" height="50%" rx="15"/>
        <clipPath id="clip">
          <use xlink:href="#rect"/>
        </clipPath>
      </defs>
    
      <use xlink:href="#rect" stroke-width="2" stroke="black"/>
      <image xlink:href="boston.jpg" width="100%" height="100%" clip-path="url(#clip)"/>
    

    It’s also possible to create several rect elements instead of using <use>.

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

Sidebar

Related Questions

I'm trying to make a box with rounded corners where the height and width
I am trying to make the corners of a Window (WPF) rounded and it
After trying to make a while(bool) loop and it failing because I couldn't see
I have been trying for the last week to find a way to make
Trying to make a sliding panel where you can click next and back to
Trying to make a simple toggle menu, and I can't seem to hide/show the
I am trying to make a cool background effect (with alpha transparency and rounded
trying to make 5 curl childs for curl handler and defining them, but can't
I am trying to make a NSScrollView with clipped corners, similar to the Twitter
I'm trying to make a rounded button using -webkit-border-radius This gives me this button

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.