Hallo,
heute will ich es wissen was dran ist am schließenden Slash bei meta-Tags und br-Tag.
Nach meinen bisherigen Infos wurde immer empfohlen bei .php Webpages insbesondere bei <br> dieses so zu verwenden: <br />
Bei den HTML meta-Tags wird dies auch empfohlen:
<meta name="description" content="" />
<meta id="keywords" name="keywords" content="" />
<meta name="robots" content="index,follow" />
Bei w3schools wird dies bei meta-Tags empfohlen:
"In HTML the <meta> tag has no end tag.
In XHTML the <meta> tag must be properly closed."
https://www.w3schools.com/tags/tag_meta.asp
und dies bei br-Tags:
"In HTML, the <br> tag has no end tag.
In XHTML, the <br> tag must be properly closed, like this: <br />."
https://www.w3schools.com/TAgs/tag_br.asp
Da eine .php Datei nicht zwangsläufig eine XHTML-Webpage ist, ist der schließende Slash also in PHP-HTML-Webpages, wie zB in HTML5, nicht notwendig?
index.php
w3schools verwendet kein <br /> bei PHP.
Example 2: https://www.w3schools.com/php/func_string_echo.asp
???
heute will ich es wissen was dran ist am schließenden Slash bei meta-Tags und br-Tag.
Nach meinen bisherigen Infos wurde immer empfohlen bei .php Webpages insbesondere bei <br> dieses so zu verwenden: <br />
Bei den HTML meta-Tags wird dies auch empfohlen:
<meta name="description" content="" />
<meta id="keywords" name="keywords" content="" />
<meta name="robots" content="index,follow" />
Bei w3schools wird dies bei meta-Tags empfohlen:
"In HTML the <meta> tag has no end tag.
In XHTML the <meta> tag must be properly closed."
https://www.w3schools.com/tags/tag_meta.asp
und dies bei br-Tags:
"In HTML, the <br> tag has no end tag.
In XHTML, the <br> tag must be properly closed, like this: <br />."
https://www.w3schools.com/TAgs/tag_br.asp
Da eine .php Datei nicht zwangsläufig eine XHTML-Webpage ist, ist der schließende Slash also in PHP-HTML-Webpages, wie zB in HTML5, nicht notwendig?
index.php
HTML-Code:
<!doctype html> <html lang="de"> <head> <meta charset="utf-8"> <meta name="description" content=""> <meta id="keywords" name="keywords" content=""> <meta name="robots" content="index,follow"> </head> <body> <?php $str = "Hello world!"; echo $str; echo "<br>What a nice day!"; ?> </body> </html>
Example 2: https://www.w3schools.com/php/func_string_echo.asp
???
Kommentar