Jump to content
Sign in to follow this  
rajat porwal

how could i do this?

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

You cannot put HTML inside an SVG.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...