Add the style to the css, and .Menu should be .menu
.Menu
{
width: 100%;
height: 50px;
position: fixed;
background-color: #35f5ca;
top: 0;
left: 0;
}
.title
{
font-family:"Sans-Serif";
position:fixed;
top: 1%;
left: 0;
vertical-align: middle;
font-size: 150%;
color: white;
}
.icon
{
transition: all 0.5s;
width:40px;
height:40px;
position:fixed;
right: 5px;
top: 0.5%;
opacity: 0.5;
}
.icon:hover
{
width:45px;
height:45px;
position:fixed;
right: 0px;
top: 0px;
opacity: 1.0;
}
.body
{
}
<html>
<head><title>Mettu</title>
<head>
<body>
<div class="Menu">
<p1 class="title">
<b>
Mettu
</b>
<img class="icon" src="https://stackoverflow.com/questions/43272138/images/iconplanet.png" />
</p1>
</div>
<div class="body">
</div>
<?php
//Menu
//Menu's Brain
?>
</body>
<html>
solved HTML CSS hover not working