把 <title>
放在一起被认为是不好的吗? <head>
之外的标记标签?我正在使用 PHP,我只知道加载 header.php 文件后的页面名称,其中 <head>
位于。会放置 <title>
页面后面的标记会影响 SEO 或导致任何其他与浏览器相关的问题,或者您会建议反对吗?
最佳答案
是 title
tag should only be used in the head
.
所以我猜你的 header.php
有这样一行:
<title><?php echo $title ?></title>
在你的页面上你有一个 include('pathtofile/header.php');
只需在包含行之前定义 $title
。
例子:
$title = "This is my page title";
include("includes/header.php");
或者,如果它的结构不是这样的,您可能需要对其进行一些更改。
关于html - 将 <title> 标签放在 <head> 标签之外是否被认为是不好的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38129982/