Set image behind the text using css - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Text

Description

Set image behind the text using css

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">
code {<!--from w  ww. ja  va  2  s . co  m-->
   background:url('https://www.java2s.com/style/demo/Google-Chrome.png') no-repeat -221px 0;
   width:311px;
   height:67px;
   line-height:67px;
   text-align:center;
   display:block;
}

.notice {
   font-size:51px
}
</style> 
 </head> 
 <body> 
  <code>Lorem ipsum dolor</code> 
  <code class="notice">Lorem </code>  
 </body>
</html>

Related Tutorials