<!DOCTYPE html>
<html>
<head>
<style>
body {
height: 300px;
}
#div {
position: relative;
float: left;
z-index: 10;
}
span {
display: inline-block;
border: 1px solid black;
}
span:hover {
color: green;
}
</style>
</head>
<body>
<div id="div">
<span>This text should be in a box</span>
</div>
</body>
</html>