<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Test</title>
<style>
#topBar{
width: 100%;
height: 20px;
background-color: #3366FF;
color: white;
}
#hideBar{
float: right;
color: white;
text-decoration: none;
margin-right: 5px;
}
</style>
</head>
<body>
<div id="topBar">Text<a href="#" id="hideBar" onClick="closeBar();">X</a>
<div style="clear:both;"></div>
</div>
<p id="hello">Hello World</p>
<script>function closeBar(){
document.getElementById('topBar').style.display = 'none';
}</script>
</body>
</html>