suchen
HeimWeb-FrontendHTML-TutorialEine ausführliche Einführung in HTML-Header

HTML -Element

Das

-Element enthält alle Head-Tag-Elemente. Im -Element können Sie Skripte, Stildateien (CSS) und verschiedene Metainformationen einfügen.

Element-Tags, die dem Kopfbereich hinzugefügt werden können, sind:

, <style>, <meta>, <link>, <script>, <noscript> und <base>. <hr/><h2 style="font-size: 22px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; margin-top: 10px; margin-bottom: 10px; font-weight: bold; background-color: transparent; color: rgb(0, 0, 0);"> HTML <title>-Element <p style="line-height: 16px; font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif;"> Das <title>-Tag definiert den Titel verschiedener Dokumente. <p style="line-height: 16px; font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif;"> <title> ist in HTML/XHTML-Dokumenten erforderlich. <p style="line-height: 16px; font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif;"> <title> Element:<ul style="line-height: 16px; font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif;" class=" list-paddingleft-2"><li><p> Definiert den Titel der Browser-Symbolleiste <li><p><br/><li><p> Wenn eine Webseite zu den Favoriten hinzugefügt wird, wird der in den Favoriten angezeigte Titel <li><p><br/><li><p> Titel wird auf der Suchergebnisseite der Suchmaschine angezeigt <li><p><br/><p style="line-height: 16px; font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif;"> Ein einfaches HTML-Dokument:<p style="font-size: 13px; font-family: &#39;courier new&#39;;"> <!DOCTYPE html><br/> <html><br/> <Kopf><br/> <title>Titel des Dokuments</style> </title> <br> <br><br> <br> Der Inhalt des Dokuments......<br> <br><br> <hr> <h2 style="font-size: 22px; font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; margin-top: 10px; margin-bottom: 10px; font-weight: bold; background-color: transparent; color: rgb(0, 0, 0);"> HTML <basis> Element </basis> </h2> <p style="line-height: 16px; font-size: 12px; font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif;"> Das <base>-Tag beschreibt die grundlegende Linkadresse/das Linkziel. Dieses Tag dient als Standardlink für alle Link-Tags im HTML-Dokument: </p> <p style="font-size: 13px; font-family: 'courier new';"> <kopf><br> <base href="http://www.52bcx.com/images/" target="_blank"> <br> </kopf></p> <hr> <h2 style="font-size: 22px; font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; margin-top: 10px; margin-bottom: 10px; font-weight: bold; background-color: transparent; color: rgb(0, 0, 0);"> HTML <link>-Element </h2> <p style="line-height: 16px; font-size: 12px; font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif;"> Das <link>-Tag definiert die Beziehung zwischen dem Dokument und externen Ressourcen. </p> <p style="line-height: 16px; font-size: 12px; font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif;"> Das <link>-Tag wird normalerweise verwendet, um auf ein Stylesheet zu verlinken: </p> <p style="font-size: 13px; font-family: 'courier new';"> <kopf><br> <link rel="stylesheet" type="text/css" href="mystyle.css"> <br> </kopf></p> <hr> <h2 style="font-size: 22px; font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; margin-top: 10px; margin-bottom: 10px; font-weight: bold; background-color: transparent; color: rgb(0, 0, 0);"> HTML <style>-Element </style> </h2> <p style="line-height: 16px; font-size: 12px; font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif;"> Das <style>-Tag definiert die Style-Datei-Referenzadresse des HTML-Dokuments.</style></p> <p style="line-height: 16px; font-size: 12px; font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif;"> Im <style>-Element müssen Sie die Stildatei zum Rendern des HTML-Dokuments angeben: </style></p> <p style="font-size: 13px; font-family: 'courier new';"> <kopf><br> <style type="text/css"><br/> Körper {Hintergrundfarbe:Gelb}<br/> p {Farbe:blau}<br/> </style> <br> </kopf></p> <hr> <h2 style="font-size: 22px; font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; margin-top: 10px; margin-bottom: 10px; font-weight: bold; background-color: transparent; color: rgb(0, 0, 0);"> HTML <meta>-Element </h2> <p style="line-height: 16px; font-size: 12px; font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif;"> Das Meta-Tag beschreibt einige grundlegende Metadaten. </p> <p style="line-height: 16px; font-size: 12px; font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif;"> Das <meta>-Tag stellt Metadaten bereit, die ebenfalls nicht auf der Seite angezeigt, sondern vom Browser analysiert werden. </p> <p style="line-height: 16px; font-size: 12px; font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif;"> Das META-Element wird normalerweise verwendet, um die Beschreibung einer Webseite, Schlüsselwörter, den Zeitpunkt der letzten Änderung der Datei, den Autor und andere Metadaten anzugeben. </p> <p style="line-height: 16px; font-size: 12px; font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif;"> Metadaten können von Browsern (wie Inhalte angezeigt oder Seiten neu geladen werden), Suchmaschinen (Schlüsselwörter) oder anderen Webdiensten verwendet werden. </p> <p style="line-height: 16px; font-size: 12px; font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif;"> <meta> wird im Allgemeinen im </p> platziert <meta> Tag – Verwendungsbeispiel<h2 style="font-size: 22px; font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; margin-top: 10px; margin-bottom: 10px; font-weight: bold; background-color: transparent; color: rgb(0, 0, 0);"> Schlüsselwörter für Suchmaschinen definieren: </h2> <p style="line-height: 16px; font-size: 12px; font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif;"> <meta name="keywords" content="HTML, CSS, XML, XHTML, JavaScript"></p> <p style="font-size: 13px; font-family: 'courier new';"> Definieren Sie den Beschreibungsinhalt für die Webseite: </p> <p style="line-height: 16px; font-size: 12px; font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif;"> <meta name="description" content="Kostenlose Web-Tutorials zu HTML und CSS"></p> <p style="font-size: 13px; font-family: 'courier new';"> Webautor definieren:</p> <p style="line-height: 16px; font-size: 12px; font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif;"> <meta name="author" content="Hege Refsnes"></p> <p style="font-size: 13px; font-family: 'courier new';"> Aktualisieren Sie die aktuelle Seite alle 30 Sekunden: </p> <p style="line-height: 16px; font-size: 12px; font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif;"> <meta http-equiv="refresh" content="30"></p> <p style="font-size: 13px; font-family: 'courier new';"></p> HTML <script>-Element <hr/><h2 style="font-size: 22px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; margin-top: 10px; margin-bottom: 10px; font-weight: bold; background-color: transparent; color: rgb(0, 0, 0);"> Das <script>-Tag wird zum Laden von Skriptdateien wie JavaScript verwendet. <p style="line-height: 16px; font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif;"> Das <script>-Element wird in den folgenden Abschnitten ausführlich beschrieben. <hr/><h2 style="font-size: 22px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; margin-top: 10px; margin-bottom: 10px; font-weight: bold; background-color: transparent; color: rgb(0, 0, 0);"> HTML-Kopfelement <table class="reference" style="font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; border-collapse: collapse; width: 722px;"><tbody><tr style="background-color: rgb(246, 244, 240);" class="firstRow"><th align="left" style="font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; color: rgb(255, 255, 255); background-color: rgb(85, 85, 85); border: 1px solid rgb(85, 85, 85); padding: 3px; vertical-align: top; text-align: left;" width="20%"> Tag <th align="left" style="font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; color: rgb(255, 255, 255); background-color: rgb(85, 85, 85); border: 1px solid rgb(85, 85, 85); padding: 3px; vertical-align: top; text-align: left;" width="80%"> Beschreibung <tr style="background-color: rgb(255, 255, 255);"><td style="line-height: 16px; font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; border: 1px solid rgb(212, 212, 212); padding: 7px 5px; vertical-align: top;"> <Kopf> <td style="line-height: 16px; font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; border: 1px solid rgb(212, 212, 212); padding: 7px 5px; vertical-align: top;"> Definiert die Informationen des Dokuments <tr style="background-color: rgb(246, 244, 240);"><td style="line-height: 16px; font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; border: 1px solid rgb(212, 212, 212); padding: 7px 5px; vertical-align: top;"> <Titel> <td style="line-height: 16px; font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; border: 1px solid rgb(212, 212, 212); padding: 7px 5px; vertical-align: top;"> Definiert den Titel des Dokuments <tr style="background-color: rgb(255, 255, 255);"><td style="line-height: 16px; font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; border: 1px solid rgb(212, 212, 212); padding: 7px 5px; vertical-align: top;"> <base> <td style="line-height: 16px; font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; border: 1px solid rgb(212, 212, 212); padding: 7px 5px; vertical-align: top;"> Definiert die Standard-Linkadresse des Seitenlink-Tags <tr style="background-color: rgb(246, 244, 240);"><td style="line-height: 16px; font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; border: 1px solid rgb(212, 212, 212); padding: 7px 5px; vertical-align: top;"> <link> <td style="line-height: 16px; font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; border: 1px solid rgb(212, 212, 212); padding: 7px 5px; vertical-align: top;"> Definiert die Beziehung zwischen einem Dokument und externen Ressourcen <tr style="background-color: rgb(255, 255, 255);"><td style="line-height: 16px; font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; border: 1px solid rgb(212, 212, 212); padding: 7px 5px; vertical-align: top;"> <meta> <td style="line-height: 16px; font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; border: 1px solid rgb(212, 212, 212); padding: 7px 5px; vertical-align: top;"> Definiert Metadaten in HTML-Dokumenten <tr style="background-color: rgb(246, 244, 240);"><td style="line-height: 16px; font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; border: 1px solid rgb(212, 212, 212); padding: 7px 5px; vertical-align: top;"> <script> <td style="line-height: 16px; font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; border: 1px solid rgb(212, 212, 212); padding: 7px 5px; vertical-align: top;"> Skriptdatei, die den Client definiert <tr style="background-color: rgb(255, 255, 255);"><td style="line-height: 16px; font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; border: 1px solid rgb(212, 212, 212); padding: 7px 5px; vertical-align: top;"> <Stil> <td style="line-height: 16px; font-size: 12px; font-family: &#39;Microsoft Yahei&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; border: 1px solid rgb(212, 212, 212); padding: 7px 5px; vertical-align: top;"> Stildateien, die HTML-Dokumente definieren <!--<p>Weitere Informationen--></script><p>Das obige ist der detaillierte Inhalt vonEine ausführliche Einführung in HTML-Header. Für weitere Informationen folgen Sie bitte anderen verwandten Artikeln auf der PHP chinesischen Website!</p></div><div class="wzconShengming_sp"><div class="bzsmdiv_sp">Stellungnahme</div><div>Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn</div></div></div><div class="phpgenera_Details_mainL4"><div class="phpmain1_2_top"><a href="javascript:void(0);" class="phpmain1_2_top_title">Verwandter Artikel<img class="lazy" data-src="/static/imghwm/index2_title2.png" src="/static/imghw/default1.png" alt="" /></a></div><div class="phpgenera_Details_mainL4_info"><div class="phphistorical_Version2_mids"><a href="https://m.php.cn/de/faq/1796798320.html" title="Die Zukunft von HTML, CSS und JavaScript: Webentwicklungstrends" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/001/253/068/174499214213783.jpg?x-oss-process=image/resize,p_40" alt="Die Zukunft von HTML, CSS und JavaScript: Webentwicklungstrends" src="/static/imghw/default1.png" /></a><a href="https://m.php.cn/de/faq/1796798320.html" title="Die Zukunft von HTML, CSS und JavaScript: Webentwicklungstrends" class="phphistorical_Version2_mids_title">Die Zukunft von HTML, CSS und JavaScript: Webentwicklungstrends</a><span class="Articlelist_txts_time">Apr 19, 2025 am 12:02 AM</span><p class="Articlelist_txts_p">Die zukünftigen Trends von HTML sind Semantik und Webkomponenten, die zukünftigen Trends von CSS sind CSS-in-JS und CssShudini, und die zukünftigen Trends von JavaScript sind WebAssembly und serverlos. 1. HTML -Semantik verbessern die Zugänglichkeits- und SEO -Effekte sowie Webkomponenten die Entwicklungseffizienz, aber der Browserkompatibilität sollte die Aufmerksamkeit geschenkt werden. 2. CSS-in-JS verbessert die Flexibilität des Stilmanagements, kann jedoch die Dateigröße erhöhen. CssShudini ermöglicht den direkten Betrieb des CSS -Renderings. 3.Webassembly optimiert die Browser -Anwendungsleistung, verfügt jedoch über eine steile Lernkurve, und serverloses vereinfacht die Entwicklung, erfordert jedoch eine Optimierung von Kaltstartproblemen.</p></div><div class="phphistorical_Version2_mids"><a href="https://m.php.cn/de/faq/1796797816.html" title="HTML: Die Struktur, CSS: Der Stil, JavaScript: Das Verhalten" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/001/253/068/174490615241003.jpg?x-oss-process=image/resize,p_40" alt="HTML: Die Struktur, CSS: Der Stil, JavaScript: Das Verhalten" src="/static/imghw/default1.png" /></a><a href="https://m.php.cn/de/faq/1796797816.html" title="HTML: Die Struktur, CSS: Der Stil, JavaScript: Das Verhalten" class="phphistorical_Version2_mids_title">HTML: Die Struktur, CSS: Der Stil, JavaScript: Das Verhalten</a><span class="Articlelist_txts_time">Apr 18, 2025 am 12:09 AM</span><p class="Articlelist_txts_p">Die Rollen von HTML, CSS und JavaScript in der Webentwicklung sind: 1. HTML definiert die Webseitenstruktur, 2. CSS steuert den Webseitenstil, und 3. JavaScript fügt ein dynamisches Verhalten hinzu. Zusammen bauen sie den Rahmen, die Ästhetik und die Interaktivität moderner Websites auf.</p></div><div class="phphistorical_Version2_mids"><a href="https://m.php.cn/de/faq/1796797300.html" title="Die Zukunft von HTML: Evolution und Trends im Webdesign" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/001/253/068/174481993285664.jpg?x-oss-process=image/resize,p_40" alt="Die Zukunft von HTML: Evolution und Trends im Webdesign" src="/static/imghw/default1.png" /></a><a href="https://m.php.cn/de/faq/1796797300.html" title="Die Zukunft von HTML: Evolution und Trends im Webdesign" class="phphistorical_Version2_mids_title">Die Zukunft von HTML: Evolution und Trends im Webdesign</a><span class="Articlelist_txts_time">Apr 17, 2025 am 12:12 AM</span><p class="Articlelist_txts_p">Die Zukunft von HTML ist voller unendlicher Möglichkeiten. 1) Neue Funktionen und Standards umfassen mehr semantische Tags und die Beliebtheit von Webcomponenten. 2) Der Webdesign -Trend entwickelt sich weiterhin für reaktionsschnelles und zugängliches Design. 3) Die Leistungsoptimierung verbessert die Benutzererfahrung durch reaktionsschnelle Bildlade- und faulen Ladetechnologien.</p></div><div class="phphistorical_Version2_mids"><a href="https://m.php.cn/de/faq/1796796827.html" title="HTML vs. CSS vs. JavaScript: Ein vergleichender Überblick" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/001/253/068/174473305338023.jpg?x-oss-process=image/resize,p_40" alt="HTML vs. CSS vs. JavaScript: Ein vergleichender Überblick" src="/static/imghw/default1.png" /></a><a href="https://m.php.cn/de/faq/1796796827.html" title="HTML vs. CSS vs. JavaScript: Ein vergleichender Überblick" class="phphistorical_Version2_mids_title">HTML vs. CSS vs. JavaScript: Ein vergleichender Überblick</a><span class="Articlelist_txts_time">Apr 16, 2025 am 12:04 AM</span><p class="Articlelist_txts_p">Die Rollen von HTML, CSS und JavaScript in der Webentwicklung sind: HTML ist für die Inhaltsstruktur verantwortlich, CSS ist für den Stil verantwortlich und JavaScript ist für dynamisches Verhalten verantwortlich. 1. HTML definiert die Webseitenstruktur und den Inhalt durch Tags, um die Semantik zu gewährleisten. 2. CSS steuert den Webseitenstil über Selektoren und Attribute, um es schön und einfach zu lesen. 3. JavaScript steuert das Verhalten von Webseiten über Skripte, um dynamische und interaktive Funktionen zu erzielen.</p></div><div class="phphistorical_Version2_mids"><a href="https://m.php.cn/de/faq/1796796249.html" title="HTML: Ist es eine Programmiersprache oder etwas anderes?" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/001/253/068/174464723172609.jpg?x-oss-process=image/resize,p_40" alt="HTML: Ist es eine Programmiersprache oder etwas anderes?" src="/static/imghw/default1.png" /></a><a href="https://m.php.cn/de/faq/1796796249.html" title="HTML: Ist es eine Programmiersprache oder etwas anderes?" class="phphistorical_Version2_mids_title">HTML: Ist es eine Programmiersprache oder etwas anderes?</a><span class="Articlelist_txts_time">Apr 15, 2025 am 12:13 AM</span><p class="Articlelist_txts_p">HtmlisnotaprogrammingLanguage; itiSamarkuplanguage.1) htmlstructuresandFormatswebcontentuses.2) itWorkswithCSSForstylingandjavaScriptForinteraktivität, EnhancingWebDevelopment.</p></div><div class="phphistorical_Version2_mids"><a href="https://m.php.cn/de/faq/1796795665.html" title="HTML: Erstellen der Struktur von Webseiten" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/001/253/068/174456085285529.jpg?x-oss-process=image/resize,p_40" alt="HTML: Erstellen der Struktur von Webseiten" src="/static/imghw/default1.png" /></a><a href="https://m.php.cn/de/faq/1796795665.html" title="HTML: Erstellen der Struktur von Webseiten" class="phphistorical_Version2_mids_title">HTML: Erstellen der Struktur von Webseiten</a><span class="Articlelist_txts_time">Apr 14, 2025 am 12:14 AM</span><p class="Articlelist_txts_p">HTML ist der Eckpfeiler der Erstellung von Webseitenstruktur. 1. HTML definiert die Inhaltsstruktur und die Semantik und Verwendung usw. Tags. 2. Stellen Sie semantische Marker wie usw. zur Verfügung, um den SEO -Effekt zu verbessern. 3. Um die Benutzerinteraktion durch Tags zu verwirklichen, achten Sie auf die Verifizierung der Form. 4. Verwenden Sie fortschrittliche Elemente wie in Kombination mit JavaScript, um dynamische Effekte zu erzielen. 5. Zu den häufigen Fehlern gehören nicht abgegebene Bezeichnungen und nicht geeignete Attributwerte, und Überprüfungstools sind erforderlich. 6. Optimierungsstrategien umfassen das Reduzieren von HTTP -Anforderungen, die Komprimierung von HTML, die Verwendung semantischer Tags usw.</p></div><div class="phphistorical_Version2_mids"><a href="https://m.php.cn/de/faq/1796795191.html" title="Von Text zu Websites: Die Kraft von HTML" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/001/253/068/174447404295304.jpg?x-oss-process=image/resize,p_40" alt="Von Text zu Websites: Die Kraft von HTML" src="/static/imghw/default1.png" /></a><a href="https://m.php.cn/de/faq/1796795191.html" title="Von Text zu Websites: Die Kraft von HTML" class="phphistorical_Version2_mids_title">Von Text zu Websites: Die Kraft von HTML</a><span class="Articlelist_txts_time">Apr 13, 2025 am 12:07 AM</span><p class="Articlelist_txts_p">HTML ist eine Sprache, mit der Webseiten erstellt, die Webseitenstruktur und -inhalt über Tags und Attribute definiert werden. 1) HTML organisiert die Dokumentstruktur über Tags, wie z. B.. 2) Der Browser analysiert HTML, um das DOM zu erstellen und die Webseite zu rendern. 3) Neue Merkmale von HTML5, wie z. B. Multimedia -Funktionen. 4) Zu den häufigen Fehlern gehören nicht abgestimmte Bezeichnungen und nicht geeignete Attributwerte. 5) Die Optimierungsvorschläge umfassen die Verwendung semantischer Tags und die Reduzierung der Dateigröße.</p></div><div class="phphistorical_Version2_mids"><a href="https://m.php.cn/de/faq/1796794693.html" title="HTML, CSS und JavaScript verstehen: Ein Anfängerhandbuch" class="phphistorical_Version2_mids_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/article/001/253/068/174438733162787.jpg?x-oss-process=image/resize,p_40" alt="HTML, CSS und JavaScript verstehen: Ein Anfängerhandbuch" src="/static/imghw/default1.png" /></a><a href="https://m.php.cn/de/faq/1796794693.html" title="HTML, CSS und JavaScript verstehen: Ein Anfängerhandbuch" class="phphistorical_Version2_mids_title">HTML, CSS und JavaScript verstehen: Ein Anfängerhandbuch</a><span class="Articlelist_txts_time">Apr 12, 2025 am 12:02 AM</span><p class="Articlelist_txts_p">WebdevelopmentRelieSonHtml, CSS und JavaScript: 1) HtmlStructuresContent, 2) CSSstylesit und 3) JavaScriptaddssinteraktivität, Bildung von TheBasisofModerernwebexperiences.</p></div></div><a href="https://m.php.cn/web-designer.html" class="phpgenera_Details_mainL4_botton"><span>See all articles</span><img class="lazy" data-src="/static/imghwm/down_right.png" src="/static/imghw/default1.png" alt="" /></a></div><ins class="adsbygoogle" style="display:block" data-ad-format="fluid" data-ad-layout-key="-6t+ed+2i-1n-4w" data-ad-client="ca-pub-5902227090019525" data-ad-slot="8966999616"></ins><script> (adsbygoogle = window.adsbygoogle || []).push({}); </script><div class="AI_ToolDetails_main4sR"><div class="phpgenera_Details_mainR3"><div class="phpmain1_4R_readrank"><div class="phpmain1_4R_readrank_top"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="/static/imghwm/hottools2.png" src="/static/imghw/default1.png" alt="" /><h2>Heiße KI -Werkzeuge</h2></div><div class="phpgenera_Details_mainR3_bottom"><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/de/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/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://m.php.cn/de/ai/undresserai-undress" title="Undresser.AI Undress"class="phpmain_tab2_mids_title"><h3>Undresser.AI Undress</h3></a><p>KI-gestützte App zum Erstellen realistischer Aktfotos</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/de/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/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://m.php.cn/de/ai/ai-clothes-remover" title="AI Clothes Remover"class="phpmain_tab2_mids_title"><h3>AI Clothes Remover</h3></a><p>Online-KI-Tool zum Entfernen von Kleidung aus Fotos.</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/de/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/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://m.php.cn/de/ai/undress-ai-tool" title="Undress AI Tool"class="phpmain_tab2_mids_title"><h3>Undress AI Tool</h3></a><p>Ausziehbilder kostenlos</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/de/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/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://m.php.cn/de/ai/clothoffio" title="Clothoff.io"class="phpmain_tab2_mids_title"><h3>Clothoff.io</h3></a><p>KI-Kleiderentferner</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/de/ai/ai-hentai-generator" title="AI Hentai Generator" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/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://m.php.cn/de/ai/ai-hentai-generator" title="AI Hentai Generator"class="phpmain_tab2_mids_title"><h3>AI Hentai Generator</h3></a><p>Erstellen Sie kostenlos Ai Hentai.</p></div></div></div><div class="phpgenera_Details_mainR3_more"><a href="https://m.php.cn/de/ai">Mehr anzeigen</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/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="/static/imghwm/hotarticle2.png" src="/static/imghw/default1.png" alt="" /><h2>Heißer Artikel</h2></div><div class="phpgenera_Details_mainR4_bottom"><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/de/faq/1796785841.html" title="Assassin's Creed Shadows: Seashell Riddle -Lösung" class="phpgenera_Details_mainR4_bottom_title">Assassin's Creed Shadows: Seashell Riddle -Lösung</a><div class="phpgenera_Details_mainR4_bottoms_info"><span>3 Wochen vor</span><span>ByDDD</span></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/de/faq/1796789525.html" title="Was ist neu in Windows 11 KB5054979 und wie Sie Update -Probleme beheben" class="phpgenera_Details_mainR4_bottom_title">Was ist neu in Windows 11 KB5054979 und wie Sie Update -Probleme beheben</a><div class="phpgenera_Details_mainR4_bottoms_info"><span>2 Wochen vor</span><span>ByDDD</span></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/de/faq/1796785857.html" title="Wo kann man die Kransteuerungsschlüsselkarten in Atomfall finden" class="phpgenera_Details_mainR4_bottom_title">Wo kann man die Kransteuerungsschlüsselkarten in Atomfall finden</a><div class="phpgenera_Details_mainR4_bottoms_info"><span>3 Wochen vor</span><span>ByDDD</span></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/de/faq/1796781206.html" title="Ersparnis in R.E.P.O. Erklärt (und speichern Dateien)" class="phpgenera_Details_mainR4_bottom_title">Ersparnis in R.E.P.O. Erklärt (und speichern Dateien)</a><div class="phpgenera_Details_mainR4_bottoms_info"><span>1 Monate vor</span><span>By尊渡假赌尊渡假赌尊渡假赌</span></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/de/faq/1796783009.html" title="Assassins Creed Shadows - So finden Sie den Schmied und entsperren Sie die Waffen- und Rüstungsanpassung" class="phpgenera_Details_mainR4_bottom_title">Assassins Creed Shadows - So finden Sie den Schmied und entsperren Sie die Waffen- und Rüstungsanpassung</a><div class="phpgenera_Details_mainR4_bottoms_info"><span>3 Wochen vor</span><span>ByDDD</span></div></div></div><div class="phpgenera_Details_mainR3_more"><a href="https://m.php.cn/de/article.html">Mehr anzeigen</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/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="/static/imghwm/hottools2.png" src="/static/imghw/default1.png" alt="" /><h2>Heiße Werkzeuge</h2></div><div class="phpgenera_Details_mainR3_bottom"><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/toolset/development-tools/93" title="SublimeText3 chinesische Version" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97a3baad9677.jpg" src="/static/imghw/default1.png" alt="SublimeText3 chinesische Version" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/toolset/development-tools/93" title="SublimeText3 chinesische Version" class="phpmain_tab2_mids_title"><h3>SublimeText3 chinesische Version</h3></a><p>Chinesische Version, sehr einfach zu bedienen</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/toolset/development-tools/1544" title="MinGW – Minimalistisches GNU für Windows" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="" src="/static/imghw/default1.png" alt="MinGW – Minimalistisches GNU für Windows" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/toolset/development-tools/1544" title="MinGW – Minimalistisches GNU für Windows" class="phpmain_tab2_mids_title"><h3>MinGW – Minimalistisches GNU für Windows</h3></a><p>Dieses Projekt wird derzeit auf osdn.net/projects/mingw migriert. Sie können uns dort weiterhin folgen. MinGW: Eine native Windows-Portierung der GNU Compiler Collection (GCC), frei verteilbare Importbibliotheken und Header-Dateien zum Erstellen nativer Windows-Anwendungen, einschließlich Erweiterungen der MSVC-Laufzeit zur Unterstützung der C99-Funktionalität. Die gesamte MinGW-Software kann auf 64-Bit-Windows-Plattformen ausgeführt werden.</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/toolset/development-tools/469" title="Dreamweaver CS6" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d0e0fc74683535.jpg" src="/static/imghw/default1.png" alt="Dreamweaver CS6" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/toolset/development-tools/469" title="Dreamweaver CS6" class="phpmain_tab2_mids_title"><h3>Dreamweaver CS6</h3></a><p>Visuelle Webentwicklungstools</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/toolset/development-tools/1557" title="mPDF" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/003/169206948656118.png" src="/static/imghw/default1.png" alt="mPDF" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/toolset/development-tools/1557" title="mPDF" class="phpmain_tab2_mids_title"><h3>mPDF</h3></a><p>mPDF ist eine PHP-Bibliothek, die PDF-Dateien aus UTF-8-codiertem HTML generieren kann. Der ursprüngliche Autor, Ian Back, hat mPDF geschrieben, um PDF-Dateien „on the fly“ von seiner Website auszugeben und verschiedene Sprachen zu verarbeiten. Es ist langsamer und erzeugt bei der Verwendung von Unicode-Schriftarten größere Dateien als Originalskripte wie HTML2FPDF, unterstützt aber CSS-Stile usw. und verfügt über viele Verbesserungen. Unterstützt fast alle Sprachen, einschließlich RTL (Arabisch und Hebräisch) und CJK (Chinesisch, Japanisch und Koreanisch). Unterstützt verschachtelte Elemente auf Blockebene (wie P, DIV),</p></div></div><div class="phpmain_tab2_mids_top"><a href="https://m.php.cn/toolset/development-tools/121" title="Senden Sie Studio 13.0.1" class="phpmain_tab2_mids_top_img"><img onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97ecd1ab2670.jpg" src="/static/imghw/default1.png" alt="Senden Sie Studio 13.0.1" /></a><div class="phpmain_tab2_mids_info"><a href="https://m.php.cn/toolset/development-tools/121" title="Senden Sie Studio 13.0.1" class="phpmain_tab2_mids_title"><h3>Senden Sie Studio 13.0.1</h3></a><p>Leistungsstarke integrierte PHP-Entwicklungsumgebung</p></div></div></div><div class="phpgenera_Details_mainR3_more"><a href="https://m.php.cn/de/ai">Mehr anzeigen</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/imghwm/default1.png'" onerror="this.onerror=''; this.src='/static/imghwm/default1.png'" class="lazy" data-src="/static/imghwm/hotarticle2.png" src="/static/imghw/default1.png" alt="" /><h2>Heiße Themen</h2></div><div class="phpgenera_Details_mainR4_bottom"><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/de/faq/gmailyxdlrkzn" title="Wo ist der Login-Zugang für Gmail-E-Mail?" class="phpgenera_Details_mainR4_bottom_title">Wo ist der Login-Zugang für Gmail-E-Mail?</a><div class="phpgenera_Details_mainR4_bottoms_info"><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/eyess.png" src="/static/imghw/default1.png" alt="" /><span>7563</span></div><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/tiezi.png" src="/static/imghw/default1.png" alt="" /><span>15</span></div></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/de/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 class="lazy" data-src="/static/imghwm/eyess.png" src="/static/imghw/default1.png" alt="" /><span>1384</span></div><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/tiezi.png" src="/static/imghw/default1.png" alt="" /><span>52</span></div></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/de/faq/steamdzhmcssmgs" title="Wie lautet das Format des Kontonamens von Steam?" class="phpgenera_Details_mainR4_bottom_title">Wie lautet das Format des Kontonamens von Steam?</a><div class="phpgenera_Details_mainR4_bottoms_info"><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/eyess.png" src="/static/imghw/default1.png" alt="" /><span>84</span></div><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/tiezi.png" src="/static/imghw/default1.png" alt="" /><span>11</span></div></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/de/faq/winactivationkeyper" title="Win11 -Aktivierungsschlüssel dauerhaft" class="phpgenera_Details_mainR4_bottom_title">Win11 -Aktivierungsschlüssel dauerhaft</a><div class="phpgenera_Details_mainR4_bottoms_info"><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/eyess.png" src="/static/imghw/default1.png" alt="" /><span>60</span></div><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/tiezi.png" src="/static/imghw/default1.png" alt="" /><span>19</span></div></div></div><div class="phpgenera_Details_mainR4_bottoms"><a href="https://m.php.cn/de/faq/newyorktimesdailybrief" title="NYT -Verbindungen Hinweise und Antworten" class="phpgenera_Details_mainR4_bottom_title">NYT -Verbindungen Hinweise und Antworten</a><div class="phpgenera_Details_mainR4_bottoms_info"><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/eyess.png" src="/static/imghw/default1.png" alt="" /><span>28</span></div><div class="phpgenera_Details_mainR4_bottoms_infos"><img class="lazy" data-src="/static/imghwm/tiezi.png" src="/static/imghw/default1.png" alt="" /><span>99</span></div></div></div></div><div class="phpgenera_Details_mainR3_more"><a href="https://m.php.cn/de/faq/zt">Mehr anzeigen</a></div></div></div></div></main><ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5902227090019525" data-ad-slot="5027754603"></ins><script> (adsbygoogle = window.adsbygoogle || []).push({}); </script><footer><div class="footer"><div class="footertop"><img src="/static/imghwm/logo.png" alt=""><p>Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!</p></div><div class="footermid"><a href="https://m.php.cn/de/about/us.html">Über uns</a><a href="https://m.php.cn/de/about/disclaimer.html">Haftungsausschluss</a><a href="https://m.php.cn/de/update/article_0_1.html">Sitemap</a></div><div class="footerbottom"><p> © php.cn All rights reserved </p></div></div></footer><script>isLogin = 0;</script><script type="text/javascript" src="/static/layui/layui.js"></script><script type="text/javascript" src="/static/js/global.js?4.9.47"></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' 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> 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> jQuery.fn.wait = function (func, times, interval) { var _times = times || -1, //100次 _interval = interval || 20, //20毫秒每次 _self = this, _selector = this.selector, //选择器 _iIntervalID; //定时器id if( this.length ){ //如果已经获取到了,就直接执行函数 func && func.call(this); } else { _iIntervalID = setInterval(function() { if(!_times) { //是0就退出 clearInterval(_iIntervalID); } _times <= 0 || _times--; //如果是正数就 -- _self = $(_selector); //再次选择 if( _self.length ) { //判断是否取到 func && func.call(_self); clearInterval(_iIntervalID); } }, _interval); } return this; } $("table.syntaxhighlighter").wait(function() { $('table.syntaxhighlighter').append("<p class='cnblogs_code_footer'><span class='cnblogs_code_footer_icon'></span></p>"); }); $(document).on("click", ".cnblogs_code_footer",function(){ $(this).parents('table.syntaxhighlighter').css('display','inline-table');$(this).hide(); }); $('.nphpQianCont').viewer({navbar:true,title:false,toolbar:false,movable:false,viewed:function(){$('img').click(function(){$('.viewer-close').trigger('click');});}}); </script><script>// 通用函数,用于显示或隐藏元素 function toggleElementsDisplay(className, show) { const elements = document.getElementsByClassName(className); for (let i = 0; i < elements.length; i++) { elements[i].style.display = show ? "block" : "none"; } } // 页面加载完成后执行的主函数 document.addEventListener("DOMContentLoaded", () => { // 1. 绑定菜单按钮事件 const bindMenuEvents = () => { const toggleDisplay = (className, show, eventId) => { const element = document.getElementById(eventId); if (element) { element.addEventListener("click", (event) => { event.preventDefault(); toggleElementsDisplay(className, show); }); } }; toggleDisplay("m_editormain12main", true, "fixed_tab_img"); toggleDisplay("m_editormain12main", false, "fixed_tab_topi"); toggleDisplay("m_editormain12main", false, "fixed_tab_close"); toggleDisplay("m_menu", true, "lan1sp"); toggleDisplay("m_menu", false, "m_editormain12main_topi_sp"); toggleDisplay("m_menu_lang", true, "lan1"); toggleDisplay("m_menu_lang", false, "m_editormain12main_topi_lan"); }; // 2. 绑定滚动链接事件 const bindScrollLinks = () => { const titleList = document.getElementById("fixed_tab_titlelist"); const menuMain = document.getElementsByClassName("m_editormain12main")[0]; const links = document.querySelectorAll('.fixed_tab_a'); links.forEach(linkElement => { if (linkElement) { linkElement.addEventListener("click", async (e) => { e.preventDefault(); e.stopPropagation(); // 先隐藏菜单 if (menuMain) menuMain.style.display = "none"; if (titleList) titleList.style.display = "none"; // 获取目标元素的 ID const targetId = linkElement.getAttribute('href').substring(1); const targetElement = document.getElementById(targetId); // 等待 DOM 更新 await new Promise(resolve => requestAnimationFrame(resolve)); // 滚动到目标位置 if (targetElement) { targetElement.scrollIntoView({ behavior: "smooth", block: "start" }); } }); } }); }; // 3. 绑定关闭按钮事件 const bindCloseButton = () => { const closeButton = document.querySelector(".phpgenera_Details_mainR1_close"); const container = document.querySelector(".phpgenera_Details_mainR1"); if (closeButton && container) { closeButton.addEventListener("click", (event) => { event.preventDefault(); container.style.display = "none"; }); } }; // 4. 初始化菜单交互功能 const initMenuInteraction = () => { const menuGroupElements = document.querySelectorAll('.layui-menu-item-group'); menuGroupElements.forEach(menuItem => { menuItem.addEventListener('click', function(event) { if (event.target.closest('.m_menusnames')) { return; } this.classList.toggle('layui-menu-item-down'); this.classList.toggle('layui-menu-item-up'); const subMenuContainer = this.querySelector('.m_menusnames'); const icon = this.querySelector('.layui-icon'); if (subMenuContainer && icon) { if (this.classList.contains('layui-menu-item-down')) { subMenuContainer.style.display = 'block'; icon.classList.remove('layui-icon-down'); icon.classList.add('layui-icon-up'); } else { subMenuContainer.style.display = 'none'; icon.classList.remove('layui-icon-up'); icon.classList.add('layui-icon-down'); } } }); }); }; // 5. 初始化 layui 功能 const initLayui = () => { if (typeof layui !== 'undefined') { layui.use(function () { var util = layui.util; if (util && util.fixbar) { util.fixbar({ on: { mouseenter: function (type) { if (layer && layer.tips) { layer.tips(type, this, { tips: 4, fixed: true, }); } }, mouseleave: function (type) { if (layer && layer.closeAll) { layer.closeAll("tips"); } }, }, }); } }); } }; // 执行所有初始化函数 bindMenuEvents(); bindScrollLinks(); bindCloseButton(); initMenuInteraction(); initLayui(); }); </script></body></html>