Align text line and place it to the center with 70% of the container width - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Text

Description

Align text line and place it to the center with 70% of the container width

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <title>stackoverflow question:answer</title> 
  <style>
.container {<!--from  w w w  .  j  a v  a  2  s  .c  o  m-->
   text-align:center;
}

.container::before {
   content:'';
   width:31%;
   display:inline-block;
}
</style> 
 </head> 
 <body translate="no"> 
  <div class="container">
    Text 
  </div>  
 </body>
</html>

Related Tutorials