html - Why does white-space nowrap have no effect on LI's in Internet Explorer? -


i li's display on same line, set each li's display property inline-block , set white-space = nowrap on parent ul. expected non-wrapping behaviour in firefox , chrome, ie8 ignores nowrap , displays items on underneath other.

any idea doing wrong?

here html , css...

<html>     <head>         <style type="text/css">              li             {                 display: inline-block;                 list-style: none outside none;                 padding: 0px 10px 0px 10px;                 white-space: nowrap;             }             ul             {                 white-space: nowrap;             }         </style>     </head>     <body>         <div style="float: left; width: 300px;">             <ul>                 <li>                     menu 1                 </li>                 <li>                     menu menu menu 2                 </li>                 <li>                     menu 3                 </li>                 <li>                     menu 4                 </li>             </ul>         </div>     </body> </html> 

if want elements display 1 next other, try removing -block of display property.

set follow :

display: inline; 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -