CSS - Fixed Position with Dynamic Width - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Fixed Position

Description

CSS - Fixed Position with Dynamic Width

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">
.search {<!--   w ww .  j a va2 s  . com-->
   border:2px solid Chartreuse;
   width:301px;
   overflow:hidden;
}

.breadcrumbs {
   border:2px solid yellow;
   display:inline;
}

.quantity {
   border:2px solid blue;
   float:right;
}
</style> 
 </head> 
 <body> 
  <div class="search"> 
   <div class="breadcrumbs">
     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie l 
   </div> 
   <div class="quantity">
     Lorem ipsum dolo 
   </div> 
  </div> 
  <h1>Lorem ip</h1> 
  <div class="search"> 
   <div class="breadcrumbs">
     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Ali 
   </div> 
   <div class="quantity">
     Lorem ipsum dolo 
   </div> 
  </div> 
  <h1>Lorem ipsum d</h1> 
  <div class="search"> 
   <div class="breadcrumbs">
     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed 
   </div> 
   <div class="quantity">
     Lorem ipsum dolor sit am 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials