主頁 > .NET開發 > SVGforeignObject表單未顯示

SVGforeignObject表單未顯示

2022-01-01 21:48:28 .NET開發

我正在嘗試在 svg 形狀中構建一個聯系表單。它是從 Corel Draw 匯出的一個非常復雜的形狀。<foreignObject>根本不顯示。我正在使用 Chrome。

這是我的代碼

.str0 {stroke:#EBEBEB;stroke-width:15.4479}
.str2 {stroke:#ED174A;stroke-width:686.579}
.str1 {stroke:#ABD4EC;stroke-width:51.4929;stroke-dasharray:51.492915 154.478745}
.fil1 {fill:none}
.fil0 {fill:#EBECEC}
.fil3 {fill:#001F49}
.fil2 {fill:#8BC1FF}
.fil4 {fill:#FEFEFE;fill-rule:nonzero}
svg{
      width:800px;
      display: block;
      margin:0 auto;
    }
<svg xmlns="http://www.w3.org/2000/svg"  xml:space="preserve"  height="131.927mm" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
         viewBox="0 0 35594 26745"
         xmlns:xlink="http://www.w3.org/1999/xlink">

        <g id="Layer_x0020_1">

            <g class="inputy">
                <circle class="fil0 str0" cx="17993" cy="13373" r="11000"/>
                <foreignObject x="50" y="50" width="200" height="150">
                    <body xmlns="http://www.w3.org/1999/xhtml">
                    <form>
                        <input type="text"/>
                        <input type="text"/>
                    </form>
                    </body>
                </foreignObject>
            </g>

            <circle class="fil1 str1" cx="17859" cy="13507" r="12018"/>
            <circle class="fil1 str2" cx="17993" cy="13373" r="13029"/>
            <path class="fil2" d="M11512 12715l-9970 -5756c-2056,3562 -2056,7950 0,11512l9970 -5756z"/>

            <path class="fil4" d="M650 11499l342 0c75,0 130,18 167,53 37,35 56,86 56,152 0,67 -20,120 -61,158 -40,38 -102,57 -185,57l-113 0 0 246 -206 0 0 -666zm206 284l51 0c40,0 68,-7 84,-21 16,-14 24,-31 24,-53 0,-21 -7,-39 -21,-53 -14,-15 -40,-22 -79,-22l-59 0 0 149z"/>
            <path id="1" class="fil4" d="M1329 11832c0,-109 30,-193 91,-254 61,-61 145,-91 253,-91 111,0 196,30 256,89 60,60 90,143 90,250 0,78 -13,141 -39,191 -26,50 -64,88 -114,116 -50,28 -111,42 -185,42 -75,0 -137,-12 -186,-36 -49,-24 -89,-62 -120,-114 -31,-52 -46,-116 -46,-194zm205 0c0,67 13,115 38,145 25,29 59,44 102,44 44,0 79,-14 103,-43 24,-29 36,-80 36,-155 0,-63 -13,-108 -38,-137 -25,-29 -60,-43 -103,-43 -42,0 -75,15 -100,44 -25,29 -38,78 -38,146z"/>
            <path id="2" class="fil4" d="M2161 11499l342 0c75,0 130,18 167,53 37,35 56,86 56,152 0,67 -20,120 -61,158 -40,38 -102,57 -185,57l-113 0 0 246 -206 0 0 -666zm206 284l51 0c40,0 68,-7 84,-21 16,-14 24,-31 24,-53 0,-21 -7,-39 -21,-53 -14,-15 -40,-22 -79,-22l-59 0 0 149z"/>
            <polygon id="3" class="fil4" points="2820,11499 3445,11499 3445,11663 3235,11663 3235,12164 3030,12164 3030,11663 2820,11663 "/>
            <path id="4" class="fil4" d="M3980 12054l-233 0 -33 110 -210 0 251 -666 225 0 249 666 -215 0 -33 -110zm-44 -144l-73 -239 -73 239 146 0zm-77 -588l159 0 -147 136 -88 0 76 -136z"/>
            <polygon id="5" class="fil4" points="4261,11499 4476,11499 4626,11978 4774,11499 4983,11499 4735,12164 4513,12164 "/>
            <polygon id="6" class="fil4" points="5083,11499 5288,11499 5288,11750 5504,11499 5777,11499 5534,11749 5789,12164 5536,12164 5395,11891 5288,12002 5288,12164 5083,12164 "/>
            <path id="7" class="fil4" d="M5831 11832c0,-109 30,-193 91,-254 61,-61 145,-91 253,-91 111,0 196,30 256,89 60,60 90,143 90,250 0,78 -13,141 -39,191 -26,50 -64,88 -114,116 -50,28 -111,42 -185,42 -75,0 -137,-12 -186,-36 -49,-24 -89,-62 -120,-114 -31,-52 -46,-116 -46,-194zm205 0c0,67 13,115 38,145 25,29 59,44 102,44 44,0 79,-14 103,-43 24,-29 36,-80 36,-155 0,-63 -13,-108 -38,-137 -25,-29 -60,-43 -103,-43 -42,0 -75,15 -100,44 -25,29 -38,78 -38,146z"/>
            <polygon id="8" class="fil4" points="6560,11499 6774,11499 6924,11978 7072,11499 7281,11499 7034,12164 6811,12164 "/>
            <path id="9" class="fil4" d="M7314 11499l228 0 135 224 134 -224 227 0 -258 387 0 279 -206 0 0 -279 -259 -387zm356 -176l159 0 -147 136 -88 0 76 -136z"/>
            <polygon id="10" class="fil4" points="652,13203 1160,13203 1160,13346 858,13346 858,13462 1117,13462 1117,13597 858,13597 858,13869 652,13869 "/>
            <path id="11" class="fil4" d="M1278 13536c0,-109 30,-193 91,-254 61,-61 145,-91 253,-91 111,0 196,30 256,89 60,60 90,143 90,250 0,78 -13,141 -39,191 -26,50 -64,88 -114,116 -50,28 -111,42 -185,42 -75,0 -137,-12 -186,-36 -49,-24 -89,-62 -120,-114 -31,-52 -46,-116 -46,-194zm205 0c0,67 13,115 38,145 25,29 59,44 102,44 44,0 79,-14 103,-43 24,-29 36,-80 36,-155 0,-63 -13,-108 -38,-137 -25,-29 -60,-43 -103,-43 -42,0 -75,15 -100,44 -25,29 -38,78 -38,146z"/>
            <path id="12" class="fil4" d="M2114 13869l0 -666 343 0c64,0 112,5 146,16 34,11 61,31 81,61 21,30 31,66 31,108 0,37 -8,69 -24,96 -16,27 -37,49 -65,65 -18,11 -42,19 -72,26 24,8 42,16 53,24 7,5 18,17 33,35 14,18 24,32 29,41l100 192 -232 0 -110 -203c-14,-26 -26,-43 -37,-51 -15,-10 -32,-15 -51,-15l-18 0 0 270 -206 0zm206 -395l87 0c9,0 28,-3 55,-9 14,-3 25,-10 33,-21 9,-11 13,-24 13,-39 0,-22 -7,-38 -20,-50 -14,-12 -39,-17 -77,-17l-90 0 0 136z"/>
            <polygon id="13" class="fil4" points="2865,13203 3136,13203 3239,13608 3343,13203 3613,13203 3613,13869 3445,13869 3445,13361 3315,13869 3163,13869 3033,13361 3033,13869 2865,13869 "/>
            <path id="14" class="fil4" d="M4210 13203l205 0 0 397c0,39 -6,76 -18,111 -12,35 -31,66 -58,92 -26,26 -54,44 -82,55 -40,15 -88,22 -144,22 -32,0 -68,-2 -106,-7 -38,-5 -70,-13 -96,-27 -26,-13 -49,-33 -71,-57 -21,-25 -36,-50 -44,-77 -13,-42 -19,-80 -19,-112l0 -397 205 0 0 406c0,36 10,65 30,85 20,20 48,31 84,31 35,0 63,-10 83,-30 20,-20 30,-48 30,-85l0 -406z"/>
            <polygon id="15" class="fil4" points="4584,13203 4789,13203 4789,13705 5111,13705 5111,13869 4584,13869 "/>
            <path id="16" class="fil4" d="M5646 13759l-233 0 -33 110 -210 0 251 -666 225 0 249 666 -215 0 -33 -110zm-44 -144l-73 -239 -73 239 146 0zm-77 -588l159 0 -147 136 -88 0 76 -136z"/>
            <path id="17" class="fil4" d="M5995 13869l0 -666 343 0c64,0 112,5 146,16 34,11 61,31 81,61 21,30 31,66 31,108 0,37 -8,69 -24,96 -16,27 -37,49 -65,65 -18,11 -42,19 -72,26 24,8 42,16 53,24 7,5 18,17 33,35 14,18 24,32 29,41l100 192 -232 0 -110 -203c-14,-26 -26,-43 -37,-51 -15,-10 -32,-15 -51,-15l-18 0 0 270 -206 0zm206 -395l87 0c9,0 28,-3 55,-9 14,-3 25,-10 33,-21 9,-11 13,-24 13,-39 0,-22 -7,-38 -20,-50 -14,-12 -39,-17 -77,-17l-90 0 0 136zm164 -314l-131 0 -101 -130 112 0 55 70 55 -70 113 0 -104 130z"/>

            <g id="odeslat">
                <path class="fil3" d="M24081 12715l9970 -5756c2056,3562 2056,7950 0,11512l-9970 -5756z"/>
                <g data-text="odeslat">
                    <path class="fil4" d="M28693 12321c0,-117 33,-208 98,-273 65,-65 156,-98 273,-98 119,0 211,32 276,96 65,64 97,154 97,269 0,84 -14,152 -42,206 -28,54 -69,95 -122,125 -53,30 -120,45 -199,45 -81,0 -148,-13 -201,-39 -53,-26 -96,-67 -129,-122 -33,-56 -49,-125 -49,-209zm221 0c0,72 14,124 40,156 27,32 64,47 110,47 48,0 85,-16 111,-46 26,-31 39,-86 39,-167 0,-67 -14,-117 -41,-148 -27,-31 -64,-47 -111,-47 -45,0 -81,16 -108,47 -27,32 -41,84 -41,157z"/>
                    <path id="1" class="fil4" d="M29593 11962l329 0c65,0 117,9 157,26 40,18 73,43 99,76 26,33 45,71 57,115 12,44 18,90 18,139 0,77 -9,136 -26,178 -17,42 -42,78 -73,106 -31,29 -64,48 -100,57 -49,13 -93,20 -132,20l-329 0 0 -717zm221 162l0 391 54 0c46,0 79,-5 99,-15 20,-10 35,-28 46,-54 11,-26 17,-67 17,-124 0,-76 -12,-128 -37,-156 -25,-28 -66,-42 -124,-42l-55 0z"/>
                    <polygon id="2" class="fil4" points="30404,11962 30997,11962 30997,12115 30626,12115 30626,12230 30970,12230 30970,12376 30626,12376 30626,12517 31008,12517 31008,12679 30404,12679 "/>
                    <path id="3" class="fil4" d="M31124 12442l210 -13c5,34 14,60 28,78 23,29 55,43 98,43 32,0 56,-7 73,-22 17,-15 26,-32 26,-52 0,-19 -8,-35 -24,-50 -16,-15 -54,-28 -113,-42 -97,-22 -166,-51 -208,-87 -42,-36 -63,-82 -63,-138 0,-37 11,-71 32,-104 21,-33 53,-59 96,-77 43,-19 102,-28 176,-28 92,0 161,17 209,51 48,34 77,88 86,163l-208 12c-6,-33 -17,-56 -35,-71 -18,-15 -42,-22 -74,-22 -26,0 -45,6 -58,16 -13,11 -20,24 -20,40 0,11 5,22 16,31 10,10 35,18 74,26 97,21 166,42 208,63 42,21 72,48 91,79 19,32 29,67 29,106 0,46 -13,88 -38,127 -26,39 -61,68 -107,88 -46,20 -103,30 -172,30 -122,0 -206,-24 -253,-70 -47,-47 -73,-106 -80,-179z"/>
                    <polygon id="4" class="fil4" points="31921,11962 32142,11962 32142,12503 32488,12503 32488,12679 31921,12679 "/>
                    <path id="5" class="fil4" d="M33065 12561l-251 0 -36 118 -226 0 270 -717 242 0 269 717 -232 0 -36 -118zm-47 -155l-78 -258 -79 258 157 0z"/>
                    <polygon id="6" class="fil4" points="33319,11962 33993,11962 33993,12139 33766,12139 33766,12679 33545,12679 33545,12139 33319,12139 "/>
                </g>
            </g>


        </g>
</svg>

如您所見,帶有輸入的表單未顯示。我嘗試添加xmlns:xhtml="http://www.w3.org/1999/xhtml"到 svg。以 開頭的標簽xhtml:xmlns="http://www.w3.org/1999/xhtml"直接添加form. 但這些都沒有幫助。我不知道我還能嘗試什么。謝謝你的想法。

uj5u.com熱心網友回復:

這是一個尺度問題。

viewBox="0 0 35594 26745"

這些數字非常大。輸入在那里,但太小了,你看不到它們。它們隱藏在 svg 的左上角。

轉載請註明出處,本文鏈接:https://www.uj5u.com/net/399998.html

標籤:html css svg

上一篇:將Flex專案置于底部

下一篇:Tailwindcss框陰影未顯示

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • WebAPI簡介

    Web體系結構: 有三個核心:資源(resource),URL(統一資源識別符號)和表示 他們的關系是這樣的:一個資源由一個URL進行標識,HTTP客戶端使用URL定位資源,表示是從資源回傳資料,媒體型別是資源回傳的資料格式。 接下來我們說下HTTP. HTTP協議的系統是一種無狀態的方式,使用請求/ ......

    uj5u.com 2020-09-09 22:07:47 more
  • asp.net core 3.1 入口:Program.cs中的Main函式

    本文分析Program.cs 中Main()函式中代碼的運行順序分析asp.net core程式的啟動,重點不是剖析原始碼,而是理清程式開始時執行的順序。到呼叫了哪些實體,哪些法方。asp.net core 3.1 的程式入口在專案Program.cs檔案里,如下。ususing System; us ......

    uj5u.com 2020-09-09 22:07:49 more
  • asp.net網站作為websocket服務端的應用該如何寫

    最近被websocket的一個問題困擾了很久,有一個需求是在web網站中搭建websocket服務。客戶端通過網頁與服務器建立連接,然后服務器根據ip給客戶端網頁發送資訊。 其實,這個需求并不難,只是剛開始對websocket的內容不太了解。上網搜索了一下,有通過asp.net core 實作的、有 ......

    uj5u.com 2020-09-09 22:08:02 more
  • ASP.NET 開源匯入匯出庫Magicodes.IE Docker中使用

    Magicodes.IE在Docker中使用 更新歷史 2019.02.13 【Nuget】版本更新到2.0.2 【匯入】修復單列匯入的Bug,單元測驗“OneColumnImporter_Test”。問題見(https://github.com/dotnetcore/Magicodes.IE/is ......

    uj5u.com 2020-09-09 22:08:05 more
  • 在webform中使用ajax

    如果你用過Asp.net webform, 說明你也算是.NET 開發的老兵了。WEBform應該是2011 2013左右,當時還用visual studio 2005、 visual studio 2008。后來基本都用的是MVC。 如果是新開發的專案,估計沒人會用webform技術。但是有些舊版 ......

    uj5u.com 2020-09-09 22:08:50 more
  • iis添加asp.net網站,訪問提示:由于擴展配置問題而無法提供您請求的

    今天在iis服務器配置asp.net網站,遇到一個問題,記錄一下: 問題:由于擴展配置問題而無法提供您請求的頁面。如果該頁面是腳本,請添加處理程式。如果應下載檔案,請添加 MIME 映射。 WindowServer2012服務器,添加角色安裝完.netframework和iis之后,運行aspx頁面 ......

    uj5u.com 2020-09-09 22:10:00 more
  • WebAPI-處理架構

    帶著問題去思考,大家好! 問題1:HTTP請求和回傳相應的HTTP回應資訊之間發生了什么? 1:首先是最底層,托管層,位于WebAPI和底層HTTP堆疊之間 2:其次是 訊息處理程式管道層,這里比如日志和快取。OWIN的參考是將訊息處理程式管道的一些功能下移到堆疊下端的OWIN中間件了。 3:控制器處理 ......

    uj5u.com 2020-09-09 22:11:13 more
  • 微信門戶開發框架-使用指導說明書

    微信門戶應用管理系統,采用基于 MVC + Bootstrap + Ajax + Enterprise Library的技術路線,界面層采用Boostrap + Metronic組合的前端框架,資料訪問層支持Oracle、SQLServer、MySQL、PostgreSQL等資料庫。框架以MVC5,... ......

    uj5u.com 2020-09-09 22:15:18 more
  • WebAPI-HTTP編程模型

    帶著問題去思考,大家好!它是什么?它包含什么?它能干什么? 訊息 HTTP編程模型的核心就是訊息抽象,表示為:HttPRequestMessage,HttpResponseMessage.用于客戶端和服務端之間交換請求和回應訊息。 HttpMethod類包含了一組靜態屬性: private stat ......

    uj5u.com 2020-09-09 22:15:23 more
  • 部署WebApi隨筆

    一、跨域 NuGet參考Microsoft.AspNet.WebApi.Cors WebApiConfig.cs中配置: // Web API 配置和服務 config.EnableCors(new EnableCorsAttribute("*", "*", "*")); 二、清除默認回傳XML格式 ......

    uj5u.com 2020-09-09 22:15:48 more
最新发布
  • C#多執行緒學習(二) 如何操縱一個執行緒

    <a href="https://www.cnblogs.com/x-zhi/" target="_blank"><img width="48" height="48" class="pfs" src="https://pic.cnblogs.com/face/2943582/20220801082530.png" alt="" /></...

    uj5u.com 2023-04-19 09:17:20 more
  • C#多執行緒學習(二) 如何操縱一個執行緒

    C#多執行緒學習(二) 如何操縱一個執行緒 執行緒學習第一篇:C#多執行緒學習(一) 多執行緒的相關概念 下面我們就動手來創建一個執行緒,使用Thread類創建執行緒時,只需提供執行緒入口即可。(執行緒入口使程式知道該讓這個執行緒干什么事) 在C#中,執行緒入口是通過ThreadStart代理(delegate)來提供的 ......

    uj5u.com 2023-04-19 09:16:49 more
  • 記一次 .NET某醫療器械清洗系統 卡死分析

    <a href="https://www.cnblogs.com/huangxincheng/" target="_blank"><img width="48" height="48" class="pfs" src="https://pic.cnblogs.com/face/214741/20200614104537.png" alt="" /&g...

    uj5u.com 2023-04-18 08:39:04 more
  • 記一次 .NET某醫療器械清洗系統 卡死分析

    一:背景 1. 講故事 前段時間協助訓練營里的一位朋友分析了一個程式卡死的問題,回過頭來看這個案例比較經典,這篇稍微整理一下供后來者少踩坑吧。 二:WinDbg 分析 1. 為什么會卡死 因為是表單程式,理所當然就是看主執行緒此時正在做什么? 可以用 ~0s ; k 看一下便知。 0:000> k # ......

    uj5u.com 2023-04-18 08:33:10 more
  • SignalR, No Connection with that ID,IIS

    <a href="https://www.cnblogs.com/smartstar/" target="_blank"><img width="48" height="48" class="pfs" src="https://pic.cnblogs.com/face/u36196.jpg" alt="" /></a>...

    uj5u.com 2023-03-30 17:21:52 more
  • 一次對pool的誤用導致的.net頻繁gc的診斷分析

    <a href="https://www.cnblogs.com/dotnet-diagnostic/" target="_blank"><img width="48" height="48" class="pfs" src="https://pic.cnblogs.com/face/3115652/20230225090434.png" alt=""...

    uj5u.com 2023-03-28 10:15:33 more
  • 一次對pool的誤用導致的.net頻繁gc的診斷分析

    <a href="https://www.cnblogs.com/dotnet-diagnostic/" target="_blank"><img width="48" height="48" class="pfs" src="https://pic.cnblogs.com/face/3115652/20230225090434.png" alt=""...

    uj5u.com 2023-03-28 10:13:31 more
  • C#遍歷指定檔案夾中所有檔案的3種方法

    <a href="https://www.cnblogs.com/xbhp/" target="_blank"><img width="48" height="48" class="pfs" src="https://pic.cnblogs.com/face/957602/20230310105611.png" alt="" /></a&...

    uj5u.com 2023-03-27 14:46:55 more
  • C#/VB.NET:如何將PDF轉為PDF/A

    <a href="https://www.cnblogs.com/Carina-baby/" target="_blank"><img width="48" height="48" class="pfs" src="https://pic.cnblogs.com/face/2859233/20220427162558.png" alt="" />...

    uj5u.com 2023-03-27 14:46:35 more
  • 武裝你的WEBAPI-OData聚合查詢

    <a href="https://www.cnblogs.com/podolski/" target="_blank"><img width="48" height="48" class="pfs" src="https://pic.cnblogs.com/face/616093/20140323000327.png" alt="" /><...

    uj5u.com 2023-03-27 14:46:16 more