- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试创建两个 php 页面:header 和 index。我在 html 中创建了它们并定义了它们的样式。现在我想把它们变成 php 文件。所以我创建了文件并将每个 html 文件的内容复制到其中。并将css文件链接放入每个文件的头部。但是在测试时我没有从我定义的内容中获得任何 css 属性。
我试图复制 css 文件的 while 路径,但它也不起作用。
索引代码如下:
<html>
<head>
<title>Velo pour tous</title>
<link rel="stylesheet" type="text/css" href="css/app.css">
</head>
<body>
<?php
include 'templates/common/header.php'
?>
<div class="acceuil-block">
<div class="title">
<h1>Bienvenue dans le site officiel de l'association des enthousiastes de vélos</h1>
</div>
<div class="button">
<form>
<label for="">Choisissez une date : </label>
<input type="date" id="start_date_interval">
</form>
</div>
</div>
<div class="sep"></div>
<div class="sep"></div>
<div class="acceuil-summary">
<h1>Découvrez notre association</h1>
<div class="sep"></div>
<div class="row">
<div class="column left">
<div class="image">
<img src="stores.png">
</div>
<h2>Qui-sommes nous ?</h2>
<p class="paragraphe_index">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc interdum, sem eu mollis malesuada, magna dolor tempus diam, vitae auctor odio magna in felis..</p>
</div>
<div class="column middle">
<div class="image">
<img src="icon (3).png">
</div>
<h2>Ce nous vous proposons</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc interdum, sem eu mollis malesuada, magna dolor tempus diam, vitae auctor odio magna in felis.</p>
</div>
<div class="column right">
<div class="image">
<img src="business-card-of-a-man-with-contact-info.png">
</div>
<h2>Contactez-nous</h2>
<p class="paragraphe_index">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc interdum, sem eu mollis malesuada, magna dolor tempus diam, vitae auctor odio magna in felis.</p>
</div>
</div>
<footer>
<div class="footerNom">Vélos pour tous</div>
</footer>
</body>
</html>
header.php 文件:
<html lang="">
<head>
<meta charset="utf-8">
<title>Velo pour tous</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../../css/app.css">
<link rel="stylesheet" type="text/css" href="Projet tech web ratt/css/app.css">
<body>
<header>
<div class="main">
<div class="logo">
<img src="C:\wamp64\www\Projet tech web ratt\ressources\logo.png">
</div>
<ul>
<li class="active"><a href="#">Accueil</a></li>
<li><a href="file:///C:/Users/ab/Documents/test%20projet/Qui%20sommes%20nous.html">Qui-sommes nous ?</a></li>
<li><a href="file:///C:/Users/ab/Documents/test%20projet/ce%20que%20nous%20vus%20proposons.html">Ce que nous vous proposons</a></li>
<li><a href="file:///C:/Users/ab/Documents/test%20projet/login.html">Connexion</a></li>
<li><a href="file:///C:/Users/ab/Documents/test%20projet/contact.html">Contactez-nous</a></li>
</ul>
</div>
<hr>
</header>
</body>
</head>
</html>
和 css 文件(我放它只是为了显示选择器并让您了解样式):
*{
margin : 0;
padding: 0;
font-family: Century Gothic;
}
header{
height:15vh;
background-size: cover;
background-position: center;
}
ul{
float: right;
list-style-type: none;
margin-top: 25px;
}
li a{
display : block;
}
ul li{
display: inline-block;
}
ul li a{
text-decoration: none;
color : #000;
padding: 5px 20px;
border: 1px solid transparent;
transition: 0.6s ease;
}
ul li a:hover{
background-color: #000;
color: #fff;
}
.acceuil-block{
background-image: linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0.5)), url(file:///C:/wamp64/www/Projet%20tech%20web%20ratt/ressources/logo.png)
background-size: cover;
background-position: center;
position: relative;
text-align: center;
}
ul li.active a{
background-color: #000;
color: #fff;
}
.logo img{
float: left;
width: 80px;
height: auto;
}
.main{
max-width: 1200px;
margin :auto;
}
.title{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.title h1{
color: #fff;
font-size: 30px;
}
.button{
position: absolute;
top: 62%;
left: 50%;
border: 1px solid #fff;
text-decoration: none;
padding: 10px 30px;
color: #fff;
transform: translate(-50%,-50%);
margin-top: 10px;
transition: 0.6s ease;
}
.button:hover{
background-color: #fff;
color: #000;
}
.sep{
margin: 30px;
}
.acceuil-summary h1{
margin-left: 20px;
font-size: 50px;
}
/* Create three unequal columns that floats next to each other */
.column {
float: left;
padding: 10px;
}
.left, .right, .middle {
text-align: center;
width: 30%;
}
.left, .right{
padding-right: 10px;
}
.row{
max-width: 900px;
margin-left: auto;
margin-right: auto;
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
.column h2{
margin: 20px 0px;
}
.paragraphe_index{
margin-top: 49px;
}
footer{
height: 90px;
background-color: #000;
color: #fff;
text-align: center;
line-height: 65px;
}
/************************Qui Sommes nous************************/
.image_quiSommesNous{
background-image:url(../videoblocks-group-of-young-happy-cyclists.png);
height:70vh;
background-size: cover;
background-position: center;
position: relative;
text-align: center;
}
.cadre_quiSommesNous{
background-color: #fff;
width: 900px;
text-align: justify;
margin-left: auto;
margin-right: auto;
position: absolute;
top: 60%;
left: 15%;
border: 1px solid #000;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
}
.cadre_quiSommesNous h1{
margin-top: 10px;
text-align: center;
}
.cadre_quiSommesNous p{
margin: 20px;
}
.footer_quiSommesNous{
height: 90px;
background-color: #000;
text-align: center;
}
.footerNom_quiSommesNous{
line-height: 65px;
color: #fff;
}
/********************ce que nous vous proposons********************/
.sep{
background-color: black;
}
.inscription{
border: 1px solid #000;
text-decoration: none;
padding: 10px 30px;
background-color: #000;
color: #fff;
transform: translate(-50%,-50%);
margin-top: 10px;
transition: 0.6s ease;
position: absolute;
}
.inscription:hover{
cursor: pointer;
background-color: #fff;
color: #000;
}
/********************login********************/
.login-page {
width: 360px;
padding: 8% 0 0;
margin: auto;
}
.form {
position: relative;
z-index: 1;
background: #FFFFFF;
max-width: 360px;
margin: 0 auto 100px;
padding: 45px;
text-align: center;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
}
.form input {
font-family: "Roboto", sans-serif;
outline: 0;
background: #f2f2f2;
width: 100%;
border: 0;
margin: 0 0 15px;
padding: 15px;
box-sizing: border-box;
font-size: 14px;
}
.form button {
font-family: "Roboto", sans-serif;
text-transform: uppercase;
outline: 0;
background: #000;
width: 100%;
border: 1px solid #000;
padding: 15px;
color: #fff;
font-size: 14px;
-webkit-transition: all 0.6 ease;
transition: all 0.6s ease;
cursor: pointer;
}
.form button:hover {
background: #fff;
color: #000;
}
.form .message {
margin: 15px 0 0;
color: #000;
font-size: 12px;
}
.form .message a {
color: #000;
}
.container {
position: relative;
z-index: 1;
max-width: 300px;
margin: 0 auto;
}
.container:before, .container:after {
content: "";
display: block;
clear: both;
}
.container .info {
margin: 50px auto;
text-align: center;
}
.container .info h1 {
margin: 0 0 15px;
padding: 0;
font-size: 36px;
font-weight: 300;
color: #1a1a1a;
}
.container .info span {
color: #4d4d4d;
font-size: 12px;
}
.container .info span a {
color: #000000;
text-decoration: none;
}
.container .info span .fa {
color: #EF3B3A;
}
/*contact*/
form textarea{
font-family: "Roboto", sans-serif;
outline: 0;
background: #f2f2f2;
width: 100%;
border: 0;
margin: 0 0 15px;
padding: 15px;
box-sizing: border-box;
font-size: 14px;
}
这也是我元素的层次结构:
C:\wamp64\www\Projet tech web ratt
-file : css
app.css
-file : ressources
all the images i am using
-file : templates
header.php
and the index.php (that is not in any of those files)
我还想指出,我导入的图片都没有显示
提前致谢
最佳答案
如果我没理解错的话,header.php 应该是一个部分文件,对吧? CSS 资源应仅在您的索引文件中定义。
根据您的目录结构,这应该可行:
templates/common/header.php
。 <html>
, <head>
, 和 <body>
.index.php
<html>
<head>
<title>Velo pour tous</title>
<link rel="stylesheet" type="text/css" href="css/app.css">
</head>
<body>
<?php include 'templates/common/header.php'; ?>
...
header.php
<header>
<div class="main">
<div class="logo">
<!-- You should be able to reference your assets like this -->
<img src="ressources/logo.png">
</div>
<ul>
<li class="active"><a href="#">Accueil</a></li>
<!-- I intentially left out your file pointer because I don't know your directory structure for these -->
<li>...</li>
</ul>
</div>
<hr>
</header>
编辑
至于您在 CSS 中引用的图像,我假设您的意思是 videoblocks-group-of-young-happy-cyclists.png
.这有助于思考这些事情,就像您实际站在当前正在运行的文件中一样。所以,如果你的目录结构是:
css/app.css
ressources/*
然后在处理CSS文件的时候,需要跳上1个目录,然后进入ressources
目录以引用图像。
像这样:
.image_quiSommesNous{
background-image:url(../ressources/videoblocks-group-of-young-happy-cyclists.png);
...
}
关于php - CSS 文件未在 php 索引和 header 中读取,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57521639/
我在让“@header”或任何其他@规则在ANTLR中工作时遇到麻烦。具有非常基本的语法,如下所示: grammar test; options { language = CSharp2;
我对来源和寄宿有疑问 我有一个ajax页面“Page A”,它将称为ajax提要“Page B” 我看到来自ajax调用的“页面B”的请求 header 具有源“http://mydomain.com
我在 pandas 中使用了数据透视表并获得了所需的数据框格式,但现在我有两行标题。数据透视表后的结果数据框如下: scenario Actual Plan
我在 pandas 中使用了数据透视表并获得了所需的数据框格式,但现在我有两行标题。数据透视表后的结果数据框如下: scenario Actual Plan
我想在主机将它们发送到网络之前修改数据包头(IP 头、TCP 头)。 例如,如果我使用 firefox 进行浏览,那么我想拦截所有来自 firefox 的数据包并修改 IP/TCP header ,然
我的 header 内容被包装到#header 中,但是当我设置边框显示结构时,它显示我的#header 的内容出现在#header 本身之后。可能是什么问题?这是我的代码: #header { bo
我是一名 Web 开发人员,使用过 PHP 和 .NET。有一年多的 Web 工作经验,我一直无法彻底了解浏览器缓存功能,希望这里的 Web Gurus 可以帮助我。我心中的问题是: 浏览器实际上是如
伙计们,我有一个问题,我不知道如何在一个 header 中连接多个 header ,我们称它为“主 header ”并使用该 header 中的函数,例如 // A.h #include class
我有一个包含 SOAP 消息的 XMLHTTPRequest。 我想添加用于标识消息并将由 C# Web 服务使用的 guid。 GUID 的目标是识别特定用户,并应护送所有用户请求以在服务器上进行身
我一直在阅读粘性标题,这是我目前所发现的。第一个粘性 header 效果很好,但是当它遇到第一个 header 时,我如何向上滚动第一个 header 并使第二个 header 卡住? http://
我想将当前基于 TableView 的数据网格转换为新的 UICollectionView 类。 这就是我当前的网格的样子: 我的网格有两个标题: 年份(2006a、2007a 等)和 类型(“收入”
我目前正在使用 Apollo 服务器。我正在尝试在响应 header 中设置一个属性。并且此属性是从客户端 graphQL 请求 header 中检索的。 我在网上查了一下。并看到了诸如使用插件或扩展
我的 Controller 的方法需要设置一个标题,例如X-Authorization .创建新对象( store Action )后,我执行转发以显示新创建的对象( show Action ): $
我正在研究一些关于 VLAN 的事情,发现了 VLAN 标签 和 header 。 如果我们有标准 802.3 以太网帧 的 MTU(1518 字节), header 802.3 中包含什么? 另外,
我是放心和 Java 的新手,我正在尝试做一个非常基本的测试来检查 API 的响应是否为 200 ok。 谁能告诉我我需要在下面的脚本中更改什么才能传递多个 header Id、Key 和 ConId
在我的项目中,我需要知道 zlib header 是什么样的。我听说它相当简单,但我找不到 zlib header 的任何描述。 例如,它是否包含魔数(Magic Number)? 最佳答案 zlib
我正在使用 JMeter 测试 HTTP 服务器,该服务器接受并验证 APIKey 并在成功时返回一个有时限的 token 。如果我有 token ,我想发送一个 token ;如果没有,我想发送一个
以太网 header 是什么样的? 是吗: 1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|
我们的应用程序支持 CORS 配置 header 。我在两个不同的主机上分别配置了 testApp。两种设置都相互独立工作。host1 上的应用程序配置有 CORS header Access-Con
tlhelp32.h 不包含 windows.h 本身是有原因的吗?我一直在与大量的编译器错误作斗争,因为我在包含 tlhelp32.h 之后包含了 windows.h。这是设计决定还是出于什么原因?
我是一名优秀的程序员,十分优秀!