gpt4 book ai didi

php - 包含文件中的类不起作用

转载 作者:太空宇宙 更新时间:2023-11-04 11:00:27 24 4
gpt4 key购买 nike

这个问题困扰我很久了。我将一个 CSS 文件包含到索引页面中,CSS 文件中的类将被忽略。怎么了?

这是在 CSS.php 文件中

<!DOCTYPE HTML>

<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="generator" content="PSPad editor, www.pspad.com">
<title>FormAssembler</title>
<script type="text/javascript" src="//code.jquery.com/jquery-2.1.4.min.js"></script>
<!-- Icon -->
<link rel="icon" href="https://student.sps-prosek.cz/~moudrmi14/Navrhy/Projekt/barchart-icon.png" type="image/gif" sizes="16x16">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

<style type="text/css">

.center{
-webkit-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75);
box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75);
}

body {background: linear-gradient(white,rgba(77, 184, 255, 0.34);}

.alignCenter {text-align: center;}
.margin0 {margin: 0 auto;}


/* INDEX */
.CCSnavbar-class {position: relative;top: 5px;width: 1300px;margin: 0 auto;}
.header {width: 1200px;margin: 0 auto;}
.line {background-color: rgb(146, 145, 145);width: 100%;height: 1px;margin-bottom: 15px;}
.content {width: 1200px;margin: 0 auto;}




</style>

        <!-- Navbar -->
<ul class="nav navbar-nav">
<li><a href="https://student.sps-prosek.cz/~moudrmi14/Navrhy/Projekt/" title="Home">HOME</a></li>
<li><a href="https://student.sps-prosek.cz/~moudrmi14/Navrhy/Projekt/slavek_veci/form_assemble.php">FORM ASSEMBLE</a></li>
<li><a href="">PROFILE</a></li>
</ul>

<!-- Navbar log/reg -->
<ul class="nav navbar-nav navbar-right">
<li><a href="https://student.sps-prosek.cz/~moudrmi14/Navrhy/Projekt/slavek_veci/registration.php"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li>
<li><button class="btn btn-link" data-toggle="modal" data-target="#myModal" style="margin-top: 8px;"><span class="glyphicon glyphicon-log-in"></span> Login</button></li>
</ul>

</div>
</nav>

<div class="center" style="margin: 0 auto; width: 1300px;background-color: white;">

<div class="filler1" style="width: 100%; height: 10px;background-color: white;margin-top: 20px;">
</div>

这是索引页的一部分

<?php include "CSS.php"; ?>

        <!-- Header -->
<div class="header">
<H1>Welcome to FormAssembler</H1>
<div class="line">
</div>
</div>

<div class="content">

页眉、内容、正文也不起作用。整个 CSS 被忽略

最佳答案

您在 CSS 文件中犯了错误。请对 CSS 属性进行语法处理。

在 body 标签语法错误之间,尝试下面的代码。

<style type="text/css">

.center{
-webkit-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75);
box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75);
}

body {background: rgba(77, 184, 255, 0.34);}

.alignCenter {text-align: center;}
.margin0 {margin: 0 auto;}


/* INDEX */
.CCSnavbar-class {position: relative;top: 5px;width: 1300px;margin: 0 auto;}
.header {width: 1200px;margin: 0 auto;}
.line {background-color: rgb(146, 145, 145);width: 100%;height: 1px;margin-bottom: 15px;}
.content {width: 1200px;margin: 0 auto;}




</style>

关于php - 包含文件中的类不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34352784/

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