I was trying to fix BOTH the menu bar and the background’s positions.
So I add this code to the body to fix the background’s position:
<body style ="width: 100%; background-image: url(images/bkgd3_1260_black.jpg); background-attachment:fixed; background-size: cover; background-position:center;>
<div id="menu-bar"> xxxxx
</div>
<---other content--->
</body>
And I put a code under head tag for fixing the menu bar’s position, i.e.:
<head>
<style type="text/css">
#menu-bar {
position: fixed;
left: 0px;
top: 0px;
width: 1000px;
height: 25px;
z-index: 100;
background-color: #040404;
font-family: Calibri;
font-size: 16px;
font-style: normal;
text-transform: none;
text-decoration:none;
color: rgb(231,231,231);
line-height: normal;
letter-spacing: normal;
text-align: left;
word-spacing: normal;
display: table-row;
background-repeat: no-repeat;
border-bottom-width: thin;
border-bottom-style: solid;
border-left-style: none;
border-right-style: none;
border-top-style: none;
border-bottom-color: rgb(204,255,38);
}
</style>
<head>
However, the result is: the background is fixed, but the menu bar is not. when I scroll down, the menu bar just disappear. I actually want it to stay at the very top.
any suggestions?
You are missing the closing ” in your body style declaration.