Making an image or text fixed on the page horizontally in CSS - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Text

Description

Making an image or text fixed on the page horizontally in 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">
.titanfall {<!--  w ww .  j a  v a 2  s. co  m-->
   background-image:url('https://www.java2s.com/style/demo/Google-Chrome.png');
   width:659px;
   height:301px;
   position:relative;
   margin:0 11%;
   text-align:center;
}
</style> 
 </head> 
 <body> 
  <div class="titanfall"> 
   <h1>Lorem ips</h1> 
  </div>  
 </body>
</html>

Related Tutorials