Two divs in the single line, the right one has an image, the left one stretches and has a centered text - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Text

Description

Two divs in the single line, the right one has an image, the left one stretches and has a centered text

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">
.pull-right {
   float:right;
   width:201px;
   height:201px;
   background:blue;
}

.dynamic-left {
   margin-right:201px;
   height:201px;
   background:yellow;
   text-align:center;
}

.clearfix:after {<!--   w ww. j  a  v  a  2  s.co  m-->
   display:block;
   content:'';
   clear:both;
}
</style> 
 </head> 
 <body> 
  <div class="clearfix"> 
   <div class="pull-right"> 
    <img src="https://www.java2s.com/style/demo/Google-Chrome.png"> 
   </div> 
   <div class="dynamic-left"> 
    <span>Lorem ipsum d</span> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials