html - Prevent linebreak of floated elements -


im trying create header of website has logo left aligned, navigation div 960px wide , centered , log in area right aligned. here screen shot of progress enter image description here

the issue login breaks new line , don't know how prevent it. floating elements doesn't work.

here fiddle

but doesnt produce same results i'm seeing when run locally.

html

<div id="header"><!-- outside container, holds logo , log in -->         <div id="logoholder">             <p>logo</p>         </div>         <div id="navigation">             <p>navigation</p>         </div>         <div id="loginholder">             <p>login</p>         </div>     </div> 

css

/*header options*/ #header{     width:100%;     background-color:green;     height:125px; }     #logoholder{         float:left;     }     #navigation{          width:960px;         background-color:blue;         margin-left:auto;         margin-right:auto;     }      #loginholder{         float:right;     } 

just re-order html following (move loginholder above navigation) , works fine:

<div id="header">     <!-- outside container, holds logo , log in -->     <div id="logoholder">         <p>logo</p>     </div>     <div id="loginholder">         <p>login</p>     </div>     <div id="navigation">         <p>navigation</p>     </div> </div> 

jsfiddle example


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -