It looks like your code is good. You may try to inspect the element using firebug addon and see any conflict there.You can also try to add height , if still not solve then you can take a look sticky header article that explain process of making it.
.header{
width: 100%;
position:fixed;
top: 0px;
height:50px;
}