css - Fixed search button top bar -


i'm trying make fixed top bar search button, facebook login, etc... bar fine, problem is, search button moving along page when changes resolution, want fixed facebook login bar, doesn't matter if change resolution, buttons have move topbar, have do? thanks.

.fixbar { width: 100%; position: fixed; left: 0px; top: 0px; height: 30px; background-image: url(../img/fixbar.png); background-repeat: repeat-x; z-index: 1; bottom: 0px; }   #search { position: fixed; left: 396px; top: 0px; width: 100%; height: 22px; z-index: 2; } 

you need set position:fixed .fixbar class , u need set position:absolute #search id.

css

.fixbar {     width: 100%;     height:30px;     position: fixed;     left: 0px;     top: 0px;     right:0 height: 30px;     background: red;     z-index: 1; } #search {     position: absolute;     right:20px;     top: 0px;     width: 30px;     height: 22px;     z-index: 2;     background:blue;  } 

html

<div class="fixbar">     <div id="search"></div> </div> 

output in here

demo


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Socket.connect doesn't throw exception in Android -

SPSS keyboard combination alters encoding -