Position: fixed demo

by unimous

HTML

<div id="wrapper">
    <div id="header">This is the header</div>
    <div id="error">This is the error</div>
    <div id="body">This is the body</div>
</div>

CSS

#wrapper {
    width: 240px;
    border: 1px solid black;
}

#header {
    height: 30px;
    background-color: #aaa;
}

#error {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 5px rgba(0,0,0,0.3);
}

#body {
    height: 300px;
}