Jump to content

how could i do this?


rajat porwal
 Share

Recommended Posts

I am not able to understand how to enter any other element under SVG. suppose if you have to put your form under the SVG CIRCLE then how you will do it. Or suggest any other idea how i can nest my form's input text field under SVG.

I also want to know weather i can align any form's input field like we can align texts.

please answere my questions.

Link to comment
Share on other sites

  • 8 months later...

Could you submit some or your relevant code?

Try

Quote

<html>
<body>
<center>
<svg style="border:5px solid blue;background-color:tan;margin:0 auto;" height="100" width="100">
    <circle cx="50" cy="50" r="40" style="fill:white;stroke:blue;stroke-width:10;" />
</svg>
</center>
</body>
</html>

 

The result is shown in the attached html file. w3forum_cirrle_rajatporwalJune3.html

Link to comment
Share on other sites

You can html element inside an SVG using foreignobject

<html>
<head>
    <meta charset="UTF-8">
    <title>HTML inside SVG</title>
    <style type="text/css"></style></head>
    <body>
        <div>I'm a div inside the HTML</div>
        <svg width="500" height="300" style="border:1px black solid">
            <foreignobject class="node" x="46" y="22" width="100" height="100">
                
                    <div style="border:1px yellow solid">I'm a div inside a SVG.</div>                
            </foreignobject>
        </svg>
        <div>Interesting! But you a Foreign Object.</div>
    </body>
</html>
 

{F20296C1-0D1B-4793-BDCD-0164DF7FD276.jpg

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...