Hi good day! I don't really know how to post here since its my first time here. Please don't hesitate to teach me the basics. Anyways here is my code.
body{
margin: 0;
padding: 0;
background: url(bg.jpg) no-repeat;
background-size: cover;
}
.box{
width: 450px;
background: rgba(0, 0, 0, 0.4);
padding: 40px;
text-align: center;
margin: auto;
margin-top: 5%;
color: white;
font-family: 'Century Gothic',sans-serif;
}
.box-img{
border-radius: 50%;
width: 200px;
height: 200px;
}
.box h1{
font-size: 40px;
letter-spacing: 4px;
font-weight: 100;
}
.box h5{
font-size: 20px;
letter-spacing: 3px;
font-weight: 100;
}
.box p{
text-align: justify;
}
ul{
margin: 0;
padding: 0;
}
.box li{
display: inline-block;
margin: 6px;
list-style: none;
}
.box li a{
color: white;
text-decoration: none;
font-size: 60px;
transition: all ease-in-out 250ms;
}
.box li a:hover{
color: #b9b9b9;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://use.fontawesome.com/d1341f9b7a.js"></script>
<link rel="stylesheet" href="style.css">
<title>Personal WebSite</title>
</head>
<body>
<div class="box">
<img src="profile.jpg" alt="" class="box-img">
<h1>DarkCode</h1>
<h5>Web Devloper - Web Designer</h5>
<?php include("menu.php"); ?>
<ul>
<li><a href="#"><i class="fa fa-facebook-square" aria-hidden="true"></i></a></li>
<li><a href="#"><i class="fa fa-twitter-square" aria-hidden="true"></i></a></li>
<li><a href="#"><i class="fa fa-google-plus-square" aria-hidden="true"></i></a></li>
</ul>
</div>
</body>
</html>
This is the php file that I want to include in the box (menu.php)
<?php
class Fruit{
public $name;
public $color;
function __construct($name, $color){
$this->name = $name;
$this->color = $color;
}
function get_name(){
return $this->name;
}
function __destruct(){
echo "<h1>The fruit is {$this->name} and the color is {$this->color}.</h1>";
}
}
$apple = new Fruit("Apple", "red");
//echo $apple->get_name();
?>
Running this code will display the echo statement outside of the box. How do I put that statement inside the div class?

