Align text center in a right floated div - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Text

Description

Align text center in a right floated div

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">
div<!--from www .  j a v  a 2 s.  c  o  m-->
 {
   float:right;
   width:201px;
   height:201px;
   border:solid 2px;
}
</style> 
 </head> 
 <body> 
  <div style="float:right"> 
   <span style="display:block;text-align:center">some text...</span> 
  </div>  
 </body>
</html>

Related Tutorials