Multi-line vertical text centering next to an image - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Text

Description

Multi-line vertical text centering next to an image

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">
#printnotice {<!--from w ww.  java  2  s. c o m-->
   float:left;
   margin-top:6px;
   margin-bottom:11px;
   width:96%;
}

#printnotice>div {
   float:left;
   margin:auto;
   display:block
}

#printnotice img {
   float:left;
   vertical-align:middle;
}

#printnotice span {
   overflow:hidden;
   display:block;
   margin-left:21px;
   font-family:Calibri;
   font-size:2.6em;
}
</style> 
 </head> 
 <body> 
  <div id="printnotice"> 
   <div> 
    <img alt="STOP" src="https://www.java2s.com/style/demo/InternetExplorer.png"> 
    <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molest</span> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials