javascript - "float: right" doesn't put the div on the right side -


i don't understand why can't work. making css vertical sidemenu , want in right side of window. have div of menu , wrapped in div, setting float right.

problem is, it's stuck on left side. want able scroll leave rest of page in same place. fiddle: http://jsfiddle.net/xqgsm/121/

this part of code:

<div id="wrap" style="height: 100%; position: absolute; overflow-y: scroll; float: right">     <div id='cssmenu'>     <ul>    <li class='active'><a href='#'><span>home</span></a></li>    <li class='has-sub'><a href='#'><span>products</span></a>       <ul>          <li><a href='#'><span>product 1</span></a></li>          <li><a href='#'><span>product 2</span></a></li>          <li><a href='#'><span>product 3</span></a></li>       </ul>    </li> 

you need wrapper width: 100% of page.

try adding:

<div id="wrap" style="height: 100%; width: 100%; position: absolute; overflow-y: scroll;"> 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -