【问题标题】:How to join 'include' in a html-document如何在 html 文档中加入“包含”
【发布时间】:2016-07-01 23:58:15
【问题描述】:

我正在尝试将页脚文档加入到索引文件中。但它不起作用,我怀疑我的 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 html css include


    【解决方案1】:

    我无法理解您要做什么,但您的问题是由于float: left 用于section 标签。浮动有很多替代方案,例如 flexgrid,,所以不要喜欢浮动。会引起很多问题。您的问题列在here

    你的php没有问题。

    【讨论】:

      【解决方案2】:

      我明白你的问题 你为什么不开始你的文件 " 如果可以看到,请在第二个文件的末尾。 并使用扩展名 .php 保存主 html 文件 相信我,您的 html 代码不会发生任何事情,即使您将文件保存在 .php 中,所有 html 内容都会运行良好

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

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

      谢谢!

      【讨论】:

        猜你喜欢
        • 2016-05-27
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-25
        • 2010-10-22
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多