html - Unable to right float a element within a div -



html - Unable to right float a element within a div -

my requirement looks simple i'm not sure whats wrong here.

i have div , within have 2 divs..im unable right float it..

html

<div id="navigation"> <div id="cart-id">cart</div> <div id="acct-id">acct</div> </div>

css

html,body{ height:100%; width:100%; margin:2; } #navigation{ width:5%; background-color:red } #cart-id{ float:right; font-weight:bold; padding-top:.5%; margin-right:5%; color:green; }

jsfiddle

it works.. when screen total screen, should create #navigation width 5% to 10% width. , see li's floated right.

demo 1

if want navbar floated right, should set float:right on #navigation instead of on <li>

demo 2

html css

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -