'text-align' Example : text align « CSS Attributes and Javascript Style Properties « HTML CSS Reference






'text-align' Example

    
<html>
<body>
<div id="myDiv" 
     style="text-align:center">
     Sample text, aligned center.
</div>
<button onclick="myDiv.style.textAlign='right';">Align Right</button>
</body>
</html>

    
      
      








Related examples in the same category

1.'text-align' Syntax and Note
2.'text-align' Possible Values
3.'text-align' is applied to