Make a list item maintain fixed position on resize - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Fixed Position

Description

Make a list item maintain fixed position on resize

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
* {<!--from  w w  w  .  j av a 2 s .c o  m-->
   margin:0;
   padding:0;
   list-style:none;
   box-sizing:border-box;
}

ul {
   background:lightyellow;
   padding:11px;
   text-align:right;
}

li {
   padding:11px 51px;
   background:lightblue;
   display:inline-block;
   margin:11px;
}

#pinned {
   float:right;
   background:lightgreen;
   margin-left:15px;
}
</style> 
 </head> 
 <body> 
  <ul> 
   <li id="pinned">Lore</li> 
   <li>Lore</li> 
   <li>Lore</li> 
   <li>Lore</li> 
   <li>Lore</li> 
   <li>Lore</li> 
  </ul>  
 </body>
</html>

Related Tutorials