p的问题它将不会停留在div中

时间:2018-12-24 09:50:15

标签: html css

我有一个问题,我有一个站点,该站点上有一个通过mysql运行的项目页面,但我不能让文本保留在框中 所以我尝试了不同的方法,但是没有用。

css文件:

.projects {
  border: 3px black solid;
  width: 25%;
  display: inline-block;

}
.projectslink a:hover{
color: white;
text-decoration: none;
}
.projectslink {
color: white;
text-decoration: none;
}
.projecttitle {
  font-size: 150%;
  display: inline-block;
  margin: 1%;
}
.projectgenre p {
  font-size: 100%;
  display: inline-block;
  display: inline-grid;
  margin: 1%;
}
.projectstatus {
font-size: 100%;
display: inline-block;
margin: 1%;
}
.projectreldate {
font-size: 100%;
display: inline-block;
margin: 1%;
}
.projectduration {
  font-size: 100%;
  display: inline-block;
  margin: 1%;
}
.projectsinner {
  margin: 1%;
  display: inline-block;
  padding: 0.5%;
}
.projectsletters {
  margin-top: 10%;
  display: inline-block;
}
.projectsphoto {
    display: inline-block;
    margin: 2%;
    padding: 2%;
}

页面:

<html>
<head>
  <title>Project - Cloudy Productions</title>
  <link rel="stylesheet" href="/site/style/style.css">
  <link rel="stylesheet" href="/site/style/menu.css">
  <link rel="stylesheet" href="/site/style/projects.css">
  <link rel="icon" href="/site/images/favicon.png"
  <Copyright (c) 2018 Cloudy Productions All Rights Reserved.>
</head>
<body>
  <?php include 'top.php'; ?>
  <div class="content">
    <h1>Projects</h1>
    <div class="projectsbox">
    <?php
    $fproject = get_projects();

    while ($projects = $fproject->fetch_assoc()) {
      ?>

<div class="projects" id="<?php echo $projects["ID"]?>">
<a class="projectslink" href="<?php echo $projects["url"] ?>">
<div class="projectsinner" id="<?php echo $projects["ID"]?>">
    <img class="projectsphoto" id="<?php echo $projects["ID"] ?>" width = "70%" height="30%" src="/site/images/<?php echo $projects["photo"] ?>">
    <div class="projectsletters" id="<?php echo $projects["ID"]?>">
<h2 class="projecttitle" id="<?php echo $projects["ID"]?>"><?php echo $projects["naam"] ?></h1>
  <p class="projectgenre"  id="<?php echo $projects["ID"]?>"><?php echo $projects["genre"]?></p>
  <p class="projectstatus" id="<?php echo $projects["ID"]?>"><?php echo $projects["stat"]?></p>
    <p class="projectreldate" id="<?php echo $projects["ID"]?>"><?php echo $projects["reldate"]?></p>
      <p class="projectduration" id="<?php echo $projects["ID"]?>"><?php echo $projects["duration"]?></p>
    </div>
</div>
</a>
</div>

      <?php
    }
     ?>
   </div>
  </div>
  <?php include 'bottom.php'; ?>
</body>
</html>

有人可以帮助我解决这个问题吗? 问题是文本不想保留在框中。

0 个答案:

没有答案