Home Web Front-end H5 Tutorial Introduction to SVG 2D in HTML5 8—Summary of document structure and related elements_html5 tutorial skills

Introduction to SVG 2D in HTML5 8—Summary of document structure and related elements_html5 tutorial skills

May 16, 2016 pm 03:50 PM
2d svg

Many basic elements have been introduced before, including structure-related combinations and reuse elements. Here we will briefly summarize the remaining relevant elements in the document structure of SVG, and then move forward to appreciate other features of SVG.
The elements of SVG documents can basically be divided into the following categories:
•Animation elements: animate, animateColor, animateMotion, animateTransform, set;
•Explanation elements: desc, metadata, title;
•Graphics Elements: circle, ellipse, line, path, polygon, polyline, rect;
• Structural elements: defs, g, svg, symbol, use;
• Gradient elements: linearGradient, radialGradient;
• Other elements :a,altGlyphDef,clipPath,color-profile,cursor,filter,font,font-face,foreignObject,image,marker,mask,pattern,script,style,switch,text,view, etc.
Among them, graphic elements, gradient elements, text, image elements and combinations have all been introduced. Here are several other elements related to structure.

View-svg element
You can place any other elements in any order within the svg element, including nested svg elements.
The commonly used attributes supported by the svg element are id, class, x, y, width, height, viewBox, preserveAspectRatio, and related attributes of fill and stroke.
The events supported by the svg element are also commonly used onload, onmouseover, onmousemove, onmousedown, onmouseup, onclick, onfocusin, onfocusout, onresize, onscroll, onunload, etc. Not much to say about the svg element. For a complete list of attributes and events, please refer to the official documentation later.

Explanatory elements-desc element and title element
Each container element (an element that can contain other container elements or graphic elements, such as: a, defs, glyph, g, Marker, mask, missing-glyph, pattern, svg, switch and symbol) and graphic elements can contain desc and title elements, both of which are auxiliary elements used to explain related situations; their contents are text . When the SVG document is rendered, these two elements will not be rendered into the graphic. The difference between these two elements is not too big. In some implementations, title appears as prompt information, so title is usually placed in the first position of the parent element.
Typical usage is as follows:

Copy code
The code is as follows:

< ;svgxmlns="http://www.w3.org/2000/svg" version="1.1"width="4in"height="3in">

Companysalesbyregion< ;/title> <br><desc> <br>Thisisabarchartwhichshows <br>companysalesbyregion. <br></desc> <br><!--Barchartdefinedasvectordata--> 🎜></svg> <br><br><br>Usually, the outermost svg element should be accompanied by a title description, so that the program is more readable. </div> <br><br>Marker-marker element <br> <strong>Marker defines graphic elements (arrows and multi-point markers) attached to one or more vertices (path, line, polyline or polygon vertices) ). Arrows can be made by attaching a marker to the start or end point of a path, line, or polyline. Multipoint markers can attach a marker to all vertices of a path, line, polyline or polygon. The </strong><br> mark is defined by the marker element, and then just set the relevant attributes (marker, marker-start, marker-mid, and marker-end) in path, line, polyline or polygon. Take an example: <br><br><br><br><div class="msgheader"> <div class="right">Copy the code<span style="CURSOR: pointer" onclick="copycode(getid('phpcode157'));"><u></u>The code is as follows:</span> </div> </div><svgwidth=" 4in"height="2in" <div class="msgborder" id="phpcode157">viewBox="0040002000"version="1.1" <br />xmlns="http://www.w3.org/2000/svg"> <br><defs> <br><markerid="Triangle" <br />viewBox="001010"refX="0"refY="5" <br />markerUnits="strokeWidth" <br />markerWidth="4"markerHeight="3" <br />orient="auto"> <br><pathd="M00L105L010z"/> <br></marker> <br></defs> <br><desc>Placinganarrowheadattheendofapath. ;/desc> <br><pathd="M1000750L2000750L25001250" <br>fill="none"stroke="black"stroke-width="100" <br>marker-end="url(#Triangle)"/> ; <br></svg> <br><br><br><strong>Let’s take a detailed look at marker-related knowledge</strong>: <br>1. Marker is a container element that can store graphic elements, container elements, animations, gradient elements, etc. in any order. <br>2. The marker element can create a new view window: set the value of the viewBox. <br>3. Marker’s more important attributes: <br>markerUnits="strokeWidth|userSpaceOnUse" <br>This attribute defines the coordinate system used by the attributes markerWidth, markerHeight and marker content. This attribute has two optional values. The first value, strokeWidth, is the default value, which means that the units of the coordinate system used by the attributes markerWidth, markerHeight and the content of the marker are equal to the value set by the stroke-width of the graphic element that references the marker. <br><br>For example, in the above example, the width of the marker element is 400 and the height is 300. However, do not be confused. The coordinates used by the path in the mark element are the new user coordinate system set by the viewBox. <br> Another value of this attribute is userSpaceOnUse, which means that the attributes markerWidth, markerHeight and the content of the marker use the coordinate system of the graphic element that references the marker. <br>refX, refY: Define the position coordinates of the referenced point aligned with the marker. For example, in the above example, the referenced point is the end point, and it should be aligned to the (0,5) position of the marker. Note that refX and refY use the end-user coordinate system transformed by the viewBox. <br>markerWidth, markerHeight: The width and height of the marker window. This is easy to understand. <br>orient: defines the angle of marker rotation. You can specify an angle or assign auto directly. <br><strong>auto means that the positive direction of the x-axis is rotated according to the following rules </strong>: <br>a. If the point where the marker is located only belongs to one path, the positive x-axis direction of the marker is the same as the direction of the path. See the example above. <br>b. If the point where the marker is located belongs to two different paths, then the positive x-axis direction of the marker is consistent with the angular bisector of the angle between the two paths. <br>4. Marker attributes of graphic elements <br><br> If a graphic element wants to reference a marker, it needs to use related attributes, mainly these three: marker-start (put the referenced marker at the starting point), marker- mid (place the referenced marker at all points except the starting point and end point), marker-end (place the referenced marker at the end point). The values ​​of these three attributes may be none (meaning not to reference the marker), marker reference (referencing a certain marker), and inherit (no need to say more about this). <br>You can also see the usage of markers from the above example. <br><br><strong>Script and style-script element and style element</strong> <br>In fact, basically all attributes (for all elements, not just text) can be associated with an element using CSS, And all CSS properties are available in SVG images. You can directly use the style attribute to style the element, or refer to the style sheet to style the element. Stylesheets should not be parsed for XML files (because they occasionally contain characters that can cause problems), so they need to be placed in an XMLCDATA section. The same goes for scripts, which need to be placed in the XMLCDATA section. Look at the following CSS example: <br><br><div class="msgheader"> <div class="right"><span style="CURSOR: pointer" onclick="copycode(getid('phpcode158'));"><u>Copy the code </u></span></div>The code is as follows:</div> <div class="msgborder" id="phpcode158"> <br><svgwidth ="400"height="200"xmlns="http://www.w3.org/2000/svg"> <br><desc>Text</desc><defs> <br><styletype ="text/css"> <br><![CDATA[ <br />.abbreviation{text-decoration:underline;} <br />]]> <br></style> <br>< /defs> <br><g> <br><textx="20"y="50"font-size="30">Colorscanbespecified</text> <br><textx="20"y ="100"font-size="30">bytheir <br><tspanfill="rgb(255,0,0)"class="abbreviation">R</tspan> <br><tspanfill= "rgb(0,255,0)"class="abbreviation">G</tspan> <br><tspanfill="rgb(0,0,255)"class="abbreviation">B</tspan>values</ text> <br><textx="20"y="150"font-size="30">orbykeywordssuchas</text> <br><textx="20"y="200"> <br><tspanstyle="fill:lightsteelblue;font-size:30">lightsteelblue</tspan>, <br></text> <br></g> <br></svg> <br> </div> <br>Look at the script example again: <br><br><div class="msgheader"> <div class="right"><span style="CURSOR: pointer" onclick="copycode(getid('phpcode159'));"><u>Copy the code</u></span></div>The code is as follows:</div> <div class="msgborder" id="phpcode159"> <br><svgwidth="500"height="300"xmlns="http://www.w3.org/2000/svg"> <br><desc>Scriptingtheonclickevent</desc> <br><defs> <br><scripttype="text/ecmascript"> <br><![CDATA[ <br />functionhideReveal(evt){ <br />varimageTarget=evt.target; <br />vartheFill=imageTarget.getAttribute("fill"); <br />if(theFill=='white') <br />imageTarget.setAttribute("fill","url(#notes)"); <br />else <br />imageTarget.setAttribute("fill","white"); <br />} <br />]]> <br></script> <br><patternid="notes"x="0"y="0"width="50"height="75" <br />patternTransform="rotate(15)" <br />patternUnits="userSpaceOnUse"> <br><ellipsecx="10"cy="30"rx="10"ry="5"/> <br><linex1="20"y1="30"x2="20"y2="0" <br />stroke-width="3"stroke="black"/> <br><linex1="20"y1="0"x2="30"y2="5" <br />stroke-width="3"stroke="black"/> <br></pattern> <br></defs> <br><ellipseonclick="hideReveal(evt)"cx="175"cy="100"rx="125"ry="60" <br />fill="url(#notes)"stroke="black"stroke-width="5"/> <br></svg> <br> </div> <br><strong>条件处理-switch元素</strong> <br>条件处理属性是能控制所在元素渲染与否的属性。基本上大多数的元素(特别是图形元素)都可以指定条件处理属性。条件处理属性有3个:requiredFeatures,requiredExtensions和systemLanguage。这些属性就是一组测试,都允许指定一个值列表(前面两个属性是空格隔开的,语言这个属性是使用逗号隔开的),默认值都为true。 <br><br>SVG的switch元素提供了按指定条件渲染的能力。switch元素是一个容器元素,可以包含图形元素,解释性元素,动画元素,a,foreignObject,g,image,svg,switch,text,use等元素。switch元素会按顺序检查直接子元素的条件处理属性,然后渲染满足自身条件的的第一个子元素,其他的子元素都会被忽略。这些属性与display属性一样,只会影响直接使用这些属性的元素的渲染,不会影响引用的元素(比如use引用的元素)。简单的说,这3个属性会影响a,altGlyph,foreignObject,textPath,tref,tspan,animate,animateColor,animateMotion,animateTransform,set等元素,不会影响defs,cursor,mask,clipPath,pattern等元素(这些元素那么不是可渲染的,要么就是引用别的元素)。<br><br><strong>注意</strong>:子元素的display和visibility属性值并不影响switch元素条件判断的结果。 <br>条件处理属性的取值列表参看官方文档,这里就看一个小例子: <br><br><div class="msgheader"> <div class="right"><span style="CURSOR: pointer" onclick="copycode(getid('phpcode160'));"><u>复制代码</u></span></div>代码如下:</div> <div class="msgborder" id="phpcode160"> <br><switch> <br><rectrequiredFeatures="http://www.w3.org/TR/SVG11/feature#Filter" <br />x="10"y="10"width="322"height="502"opacity="0.6" <br />fill="black"stroke="none"filter="url(#gblurshadow)"/> <br><rectx="10"y="10"width="322"height="502"opacity="0.6" <br />fill="black"stroke="none"/> <br></switch> <br> </div> <br>这个例子的意思简单的说就是:使用的浏览器支持filter特性,那么就绘制上面的矩形(带filter属性),如果不支持filter特性,就绘制下面的矩形。 <br>其实更多的时候,用的比较多的属性是systemLanguage,就是文本的多语言处理能力。例如: <br><br><div class="msgheader"> <div class="right"><span style="CURSOR: pointer" onclick="copycode(getid('phpcode161'));"><u>复制代码</u></span></div>代码如下:</div> <div class="msgborder" id="phpcode161"> <br><svgxmlns="http://www.w3.org/2000/svg" version="1.1"width="5cm"height="5cm"> <br><switch> <br><textx='10'y='20'systemLanguage="de">de-HAHA</text> <br><textx='10'y='20'systemLanguage="en">en-haha</text> <br></switch> <br></svg> <br> </div> <br><strong>实用参考</strong>:<br>脚本索引:<a href="http://msdn.microsoft.com/zh-cn/library/ff971910(v=vs.85).aspx">http://msdn.microsoft.com/zh-cn/library/ff971910(v=vs.85).aspx</a><br>开发中心:<a href="https://developer.mozilla.org/en/SVG">https://developer.mozilla.org/en/SVG</a><br>热门参考:<a href="http://www.chinasvg.com/">http://www.chinasvg.com/</a><br>官方文档:<a href="http://www.w3.org/TR/SVG11/">http://www.w3.org/TR/SVG11/</a> </div> </div> <div class="wzconShengming_sp"> <div class="bzsmdiv_sp">Statement of this Website</div> <div>The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn</div> </div> </div> <ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5902227090019525" data-ad-slot="2507867629"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <div class="AI_ToolDetails_main4sR"> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-5902227090019525" data-ad-slot="3653428331" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <!-- <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>Hot Article</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/faq/1796780570.html" title="R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3 weeks ago</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/faq/1796780641.html" title="R.E.P.O. Best Graphic Settings" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O. Best Graphic Settings</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3 weeks ago</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/faq/1796785841.html" title="Assassin's Creed Shadows: Seashell Riddle Solution" class="phpgenera_Details_mainR4_bottom_title">Assassin's Creed Shadows: Seashell Riddle Solution</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>2 weeks ago</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/faq/1796780520.html" title="R.E.P.O. How to Fix Audio if You Can't Hear Anyone" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O. How to Fix Audio if You Can't Hear Anyone</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3 weeks ago</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/faq/1796779766.html" title="WWE 2K25: How To Unlock Everything In MyRise" class="phpgenera_Details_mainR4_bottom_title">WWE 2K25: How To Unlock Everything In MyRise</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>4 weeks ago</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/article.html">Show More</a> </div> </div> </div> --> <div class="phpgenera_Details_mainR3"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hottools2.png" alt="" /> <h2>Hot AI Tools</h2> </div> <div class="phpgenera_Details_mainR3_bottom"> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411540686492.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undresser.AI Undress" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_title"> <h3>Undresser.AI Undress</h3> </a> <p>AI-powered app for creating realistic nude photos</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411552797167.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Clothes Remover" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_title"> <h3>AI Clothes Remover</h3> </a> <p>Online AI tool for removing clothes from photos.</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173410641626608.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undress AI Tool" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_title"> <h3>Undress AI Tool</h3> </a> <p>Undress images for free</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411529149311.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Clothoff.io" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_title"> <h3>Clothoff.io</h3> </a> <p>AI clothes remover</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ai/ai-hentai-generator" title="AI Hentai Generator" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173405034393877.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Hentai Generator" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ai/ai-hentai-generator" title="AI Hentai Generator" class="phpmain_tab2_mids_title"> <h3>AI Hentai Generator</h3> </a> <p>Generate AI Hentai for free.</p> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ai">Show More</a> </div> </div> </div> <script src="https://sw.php.cn/hezuo/cac1399ab368127f9b113b14eb3316d0.js" type="text/javascript"></script> <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>Hot Article</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/faq/1796780570.html" title="R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3 weeks ago</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/faq/1796780641.html" title="R.E.P.O. Best Graphic Settings" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O. Best Graphic Settings</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3 weeks ago</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/faq/1796785841.html" title="Assassin's Creed Shadows: Seashell Riddle Solution" class="phpgenera_Details_mainR4_bottom_title">Assassin's Creed Shadows: Seashell Riddle Solution</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>2 weeks ago</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/faq/1796780520.html" title="R.E.P.O. How to Fix Audio if You Can't Hear Anyone" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O. How to Fix Audio if You Can't Hear Anyone</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3 weeks ago</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/faq/1796779766.html" title="WWE 2K25: How To Unlock Everything In MyRise" class="phpgenera_Details_mainR4_bottom_title">WWE 2K25: How To Unlock Everything In MyRise</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>4 weeks ago</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/article.html">Show More</a> </div> </div> </div> <div class="phpgenera_Details_mainR3"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hottools2.png" alt="" /> <h2>Hot Tools</h2> </div> <div class="phpgenera_Details_mainR3_bottom"> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/toolset/development-tools/92" title="Notepad++7.3.1" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab96f0f39f7357.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="Notepad++7.3.1" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/toolset/development-tools/92" title="Notepad++7.3.1" class="phpmain_tab2_mids_title"> <h3>Notepad++7.3.1</h3> </a> <p>Easy-to-use and free code editor</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/toolset/development-tools/93" title="SublimeText3 Chinese version" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97a3baad9677.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 Chinese version" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/toolset/development-tools/93" title="SublimeText3 Chinese version" class="phpmain_tab2_mids_title"> <h3>SublimeText3 Chinese version</h3> </a> <p>Chinese version, very easy to use</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/toolset/development-tools/121" title="Zend Studio 13.0.1" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97ecd1ab2670.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="Zend Studio 13.0.1" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/toolset/development-tools/121" title="Zend Studio 13.0.1" class="phpmain_tab2_mids_title"> <h3>Zend Studio 13.0.1</h3> </a> <p>Powerful PHP integrated development environment</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/toolset/development-tools/469" title="Dreamweaver CS6" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d0e0fc74683535.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="Dreamweaver CS6" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/toolset/development-tools/469" title="Dreamweaver CS6" class="phpmain_tab2_mids_title"> <h3>Dreamweaver CS6</h3> </a> <p>Visual web development tools</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/toolset/development-tools/500" title="SublimeText3 Mac version" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d34035e2757995.png?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 Mac version" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/toolset/development-tools/500" title="SublimeText3 Mac version" class="phpmain_tab2_mids_title"> <h3>SublimeText3 Mac version</h3> </a> <p>God-level code editing software (SublimeText3)</p> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ai">Show More</a> </div> </div> </div> <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>Hot Topics</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/faq/gmailyxdlrkzn" title="Where is the login entrance for gmail email?" class="phpgenera_Details_mainR4_bottom_title">Where is the login entrance for gmail email?</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>7490</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>15</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/faq/cakephp-tutor" title="CakePHP Tutorial" class="phpgenera_Details_mainR4_bottom_title">CakePHP Tutorial</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>1377</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>52</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/faq/steamdzhmcssmgs" title="What is the format of the account name of steam" class="phpgenera_Details_mainR4_bottom_title">What is the format of the account name of steam</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>77</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>11</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/faq/winactivationkeyper" title="win11 activation key permanent" class="phpgenera_Details_mainR4_bottom_title">win11 activation key permanent</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>52</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>19</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/faq/newyorktimesdailybrief" title="nyt connections hints and answers" class="phpgenera_Details_mainR4_bottom_title">nyt connections hints and answers</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>19</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>41</span> </div> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/faq/zt">Show More</a> </div> </div> </div> </div> </div> <div class="Article_Details_main2"> <div class="phpgenera_Details_mainL4"> <div class="phpmain1_2_top"> <a href="javascript:void(0);" class="phpmain1_2_top_title">Related knowledge<img src="/static/imghw/index2_title2.png" alt="" /></a> </div> <div class="phpgenera_Details_mainL4_info"> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/faq/495551.html" title="Let's talk about how to use SVG to achieve image mosaic effect" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/000/024/6310212f7b12b873.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="Let's talk about how to use SVG to achieve image mosaic effect" /> </a> <a href="https://www.php.cn/faq/495551.html" title="Let's talk about how to use SVG to achieve image mosaic effect" class="phphistorical_Version2_mids_title">Let's talk about how to use SVG to achieve image mosaic effect</a> <span class="Articlelist_txts_time">Sep 01, 2022 am 11:05 AM</span> <p class="Articlelist_txts_p">How to use SVG to achieve image mosaic effect without using Javascript? The following article will give you a detailed understanding, I hope it will be helpful to you!</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/faq/630655.html" title="How to convert svg to jpg format" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202311/24/2023112409453734131.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="How to convert svg to jpg format" /> </a> <a href="https://www.php.cn/faq/630655.html" title="How to convert svg to jpg format" class="phphistorical_Version2_mids_title">How to convert svg to jpg format</a> <span class="Articlelist_txts_time">Nov 24, 2023 am 09:50 AM</span> <p class="Articlelist_txts_p">svg can be converted to jpg format by using image processing software, using online conversion tools, and using the Python image processing library. Detailed introduction: 1. Image processing software includes Adobe Illustrator, Inkscape and GIMP; 2. Online conversion tools include CloudConvert, Zamzar, Online Convert, etc.; 3. Python image processing library, etc.</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/faq/491444.html" title="An in-depth analysis of how to use svg icons in vue3+vite" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/000/024/626a0043e5a72935.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="An in-depth analysis of how to use svg icons in vue3+vite" /> </a> <a href="https://www.php.cn/faq/491444.html" title="An in-depth analysis of how to use svg icons in vue3+vite" class="phphistorical_Version2_mids_title">An in-depth analysis of how to use svg icons in vue3+vite</a> <span class="Articlelist_txts_time">Apr 28, 2022 am 10:48 AM</span> <p class="Articlelist_txts_p">svg images are widely used in projects. The following article will introduce how to use svg icons in vue3 + vite. I hope it will be helpful to everyone!</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/faq/646343.html" title="Produced by Peking University: The latest SOTA with texture quality and multi-view consistency, achieving 3D conversion of one image in 2 minutes" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/887/227/170489939751963.gif?x-oss-process=image/resize,m_fill,h_207,w_330" alt="Produced by Peking University: The latest SOTA with texture quality and multi-view consistency, achieving 3D conversion of one image in 2 minutes" /> </a> <a href="https://www.php.cn/faq/646343.html" title="Produced by Peking University: The latest SOTA with texture quality and multi-view consistency, achieving 3D conversion of one image in 2 minutes" class="phphistorical_Version2_mids_title">Produced by Peking University: The latest SOTA with texture quality and multi-view consistency, achieving 3D conversion of one image in 2 minutes</a> <span class="Articlelist_txts_time">Jan 10, 2024 pm 11:09 PM</span> <p class="Articlelist_txts_p">It only takes two minutes to convert pictures into 3D! It is also the kind with high texture quality and high consistency in multiple viewing angles. No matter what species it is, the single-view image when input is still like this: Two minutes later, the 3D version is completed: △ Upper, Repaint123 (NeRF); Lower, Repaint123 (GS) The new method is called Repaint123. The core idea is to combine 2D The powerful image generation capabilities of the diffusion model are combined with the texture alignment capabilities of the redraw strategy to generate high-quality, consistent images across multiple views. In addition, this study also introduces a visibility-aware adaptive repaint intensity method for overlapping regions. Repaint123 solves the problems of previous methods such as large multi-view deviation, texture degradation, and slow generation in one fell swoop. Current item</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/faq/560726.html" title="VUE3 introductory tutorial: Use Vue.js plug-in to play with SVG" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/887/227/168688014075017.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="VUE3 introductory tutorial: Use Vue.js plug-in to play with SVG" /> </a> <a href="https://www.php.cn/faq/560726.html" title="VUE3 introductory tutorial: Use Vue.js plug-in to play with SVG" class="phphistorical_Version2_mids_title">VUE3 introductory tutorial: Use Vue.js plug-in to play with SVG</a> <span class="Articlelist_txts_time">Jun 16, 2023 am 09:48 AM</span> <p class="Articlelist_txts_p">With the continuous development of modern Web front-end development, more and more technologies are widely used in actual development. Among them, Vue.js is currently one of the most popular JavaScript frameworks. It is based on the MVVM model and provides a rich API and component library, making it easier to develop responsive, reusable, and efficient web applications. The latest version of Vue.js3 has better performance and richer features than the old version, which has attracted widespread attention and research. This article will introduce to you a</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/faq/495737.html" title="Detailed explanation of using SVG to add logo to favicon" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/000/024/631802263715b383.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="Detailed explanation of using SVG to add logo to favicon" /> </a> <a href="https://www.php.cn/faq/495737.html" title="Detailed explanation of using SVG to add logo to favicon" class="phphistorical_Version2_mids_title">Detailed explanation of using SVG to add logo to favicon</a> <span class="Articlelist_txts_time">Sep 07, 2022 am 10:30 AM</span> <p class="Articlelist_txts_p">How to add logo to favicon using SVG? The following article will introduce to you how to use SVG to generate favicon with logo. I hope it will be helpful to you!</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/faq/536433.html" title="How to use svg method in vue3+vite2" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/887/227/168379890857522.png?x-oss-process=image/resize,m_fill,h_207,w_330" alt="How to use svg method in vue3+vite2" /> </a> <a href="https://www.php.cn/faq/536433.html" title="How to use svg method in vue3+vite2" class="phphistorical_Version2_mids_title">How to use svg method in vue3+vite2</a> <span class="Articlelist_txts_time">May 11, 2023 pm 05:55 PM</span> <p class="Articlelist_txts_p">1. Install vite-plugin-svg-icons. You also need to install fast-glob related dependencies. Otherwise, when vite runs npmrundev, it will report the Cannotfindmodule'fast-glob' error npmifast-glob@3.x-Dnpmivite-plugin-svg. -icons@2.x-D 2. Create a new component index.vueimport{computed}from'vue';cons under src/components/svgIcon</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/faq/536436.html" title="How to use svg in vue3+vue-cli4" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/887/227/168379908822961.png?x-oss-process=image/resize,m_fill,h_207,w_330" alt="How to use svg in vue3+vue-cli4" /> </a> <a href="https://www.php.cn/faq/536436.html" title="How to use svg in vue3+vue-cli4" class="phphistorical_Version2_mids_title">How to use svg in vue3+vue-cli4</a> <span class="Articlelist_txts_time">May 11, 2023 pm 05:58 PM</span> <p class="Articlelist_txts_p">1. Install svg-sprite-loadernpminstallsvg-sprite-loader--save-dev 2. Create a new component under src/components/svgIcon index.vueimport{computed}from"@vue/reactivity";exportdefault{name:"baseSvgIcon", props:{iconClass:{type:String},className:{type:String},},setup</p> </div> </div> <a href="https://www.php.cn/web-designer.html" class="phpgenera_Details_mainL4_botton"> <span>See all articles</span> <img src="/static/imghw/down_right.png" alt="" /> </a> </div> </div> </div> </main> <footer> <div class="footer"> <div class="footertop"> <img src="/static/imghw/logo.png" alt=""> <p>Public welfare online PHP training,Help PHP learners grow quickly!</p> </div> <div class="footermid"> <a href="https://www.php.cn/about/us.html">About us</a> <a href="https://www.php.cn/about/disclaimer.html">Disclaimer</a> <a href="https://www.php.cn/update/article_0_1.html">Sitemap</a> </div> <div class="footerbottom"> <p> © php.cn All rights reserved </p> </div> </div> </footer> <input type="hidden" id="verifycode" value="/captcha.html"> <script>layui.use(['element', 'carousel'], function () {var element = layui.element;$ = layui.jquery;var carousel = layui.carousel;carousel.render({elem: '#test1', width: '100%', height: '330px', arrow: 'always'});$.getScript('/static/js/jquery.lazyload.min.js', function () {$("img").lazyload({placeholder: "/static/images/load.jpg", effect: "fadeIn", threshold: 200, skip_invisible: false});});});</script> <script src="/static/js/common_new.js"></script> <script type="text/javascript" src="/static/js/jquery.cookie.js?1744569969"></script> <script src="https://vdse.bdstatic.com//search-video.v1.min.js"></script> <link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css?2' type='text/css' media='all' /> <script type='text/javascript' src='/static/js/viewer.min.js?1'></script> <script type='text/javascript' src='/static/js/jquery-viewer.min.js'></script> <script type="text/javascript" src="/static/js/global.min.js?5.5.53"></script> <script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function () { var u = "https://tongji.php.cn/"; _paq.push(['setTrackerUrl', u + 'matomo.php']); _paq.push(['setSiteId', '9']); var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0]; g.async = true; g.src = u + 'matomo.js'; s.parentNode.insertBefore(g, s); })(); </script> <script> // top layui.use(function () { var util = layui.util; util.fixbar({ on: { mouseenter: function (type) { layer.tips(type, this, { tips: 4, fixed: true, }); }, mouseleave: function (type) { layer.closeAll("tips"); }, }, }); }); document.addEventListener("DOMContentLoaded", (event) => { // 定义一个函数来处理滚动链接的点击事件 function setupScrollLink(scrollLinkId, targetElementId) { const scrollLink = document.getElementById(scrollLinkId); const targetElement = document.getElementById(targetElementId); if (scrollLink && targetElement) { scrollLink.addEventListener("click", (e) => { e.preventDefault(); // 阻止默认链接行为 targetElement.scrollIntoView({ behavior: "smooth" }); // 平滑滚动到目标元素 }); } else { console.warn( `Either scroll link with ID '${scrollLinkId}' or target element with ID '${targetElementId}' not found.` ); } } // 使用该函数设置多个滚动链接 setupScrollLink("Article_Details_main1L2s_1", "article_main_title1"); setupScrollLink("Article_Details_main1L2s_2", "article_main_title2"); setupScrollLink("Article_Details_main1L2s_3", "article_main_title3"); setupScrollLink("Article_Details_main1L2s_4", "article_main_title4"); setupScrollLink("Article_Details_main1L2s_5", "article_main_title5"); setupScrollLink("Article_Details_main1L2s_6", "article_main_title6"); // 可以继续添加更多的滚动链接设置 }); window.addEventListener("scroll", function () { var fixedElement = document.getElementById("Article_Details_main1Lmain"); var scrollTop = window.scrollY || document.documentElement.scrollTop; // 兼容不同浏览器 var clientHeight = window.innerHeight || document.documentElement.clientHeight; // 视口高度 var scrollHeight = document.documentElement.scrollHeight; // 页面总高度 // 计算距离底部的距离 var distanceToBottom = scrollHeight - scrollTop - clientHeight; // 当距离底部小于或等于300px时,取消固定定位 if (distanceToBottom <= 980) { fixedElement.classList.remove("Article_Details_main1Lmain"); fixedElement.classList.add("Article_Details_main1Lmain_relative"); } else { // 否则,保持固定定位 fixedElement.classList.remove("Article_Details_main1Lmain_relative"); fixedElement.classList.add("Article_Details_main1Lmain"); } }); </script> </body> </html>