gpt4 book ai didi

php - 如何在 html 文档中加入 'include'

转载 作者:行者123 更新时间:2023-11-28 02:58:02 25 4
gpt4 key购买 nike

我正在尝试将页脚文档加入索引文件。但它不起作用,我怀疑我的 css 文件有问题。

html {background: url("bakgrund.gif");} 
/*https://pixabay.com/ Gratis bilder Creative Commons CC0*/
html { overflow-y: scroll;}


body {
background: white;
border: 1px solid #0000ff;
font-family: calibri, arial, sans-serif;
width: 750px;
margin: 25px auto;
padding: 0;

}
header {
height: 175px;
background-color: #edffff;
margin-top: -16px;
padding: 0;
}

nav {
height: 35px;
background-color: #edffff;
padding-left: 10px;
}

section {
width: 550px;
float: left;
min-height: 400px;

}

article {
width: 550px;
float: left;
background-color: yellow;
}

aside {
width: 200px;
float: right;
background-color: lightgrey;
}

footer {
clear: both;
position: relative;
height: 55px;
padding: 5px ;
text-align: center;
background-color: magenta;
}

address {
font-size: 12px;
font-style: normal;
}

/* Menykataloger */


ul {
margin: 0;
padding: 0;
}


#meny li {
display: inline;
padding: 5px 1px;
}

#meny li a {
margin: 0 5px 0 5px;
padding: 5px 15px;
text-align: center;
font-family: arial;
font-size: 13px;
font-weight: bold;
color: black;
border: 1px solid black;
border-radius: 5px;
background: yellow;
}

#meny li a:hover {
background: #CCEBFF;
color: black;
}

#meny a:link, #meny a:visited {
color: black;
text-decoration: none;
}

#meny a:active {
color: white;
}

#meny a#current {
background: white;
}
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="stil.css" type="text/css">
</head>
<body>

<nav>
<ul id="meny">
<li><a href="index.html" id="current">Hem</a></li>
<li><a href="#">AAA</a></li>
<li><a href="#">BBB</a></li>
<li><a href="#">CCC</a></li>
</ul>
</nav>
<section>
<h2>Huvudrubrik</h2>
<p>Huvudinnehåll</p>

<article>
<h2>Rubrik 1</h2>
<p> Innehåll 1 med rubriker</p>
</article>

<article>
<h2>Rubrik 2</h2>
<p> Innehåll 2 med rubriker
</p>
</article>

</section>

<aside>
Nyhetsbrev H-spalt
</aside>

<?php include("fot.php"); ?>

结果对边界的解释是错误的。它只是围绕头部而不是整个区域。

最佳答案

我明白你的问题你为什么不开始你的文件 < ? php 在开始并在结束时关闭它而不是你像这样使用的 => "< ? php include("fot.php");"?> 如果你能看到的话,在你的第二个文件的末尾。并保存扩展名为 .php 的主 html 文件相信我,您的 html 代码不会发生任何事情,即使您将文件保存在 .php 中,所有 html 内容也能正常运行

第二件事是你可以用两种方式包含IE包括“文件名”;

需要'文件名';你最好包括在文件的开头谁会知道该包含的文件是否可以从一开始就使用

谢谢!

关于php - 如何在 html 文档中加入 'include',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36030017/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com