Saturday, 13 December 2014

HTML TEXT ALIGNMENT|| HTML STYLES

HTML style have various uses. We can change the text color ,Text Alignment , Text Size,font style by the use of this attribute.


HTML TEXT ALIGNMENT

In HTML,Text Alignment we can align text as per our need, We can align text e.g. center,left, right,justify.

Code  for Center Alignment  
<html>

<body>
  <h1 style="text-align:center">Centered Heading</h1>
  <p>This is a paragraph.</p>
</body>

</html> 

RESULT


TIP

The <center> tag, supported in older versions of HTML, is not valid in HTML5.

Code For Right Alignment

<html>

<body>
  <h1 style="text-align:right">Right Heading</h1>
  <p>This is a paragraph.</p>
</body>

</html>
  

Result 

 

You can use this code in your own editor.

Code For Left Alignment

<html>

<body>
  <h1 style="text-align:left">Left Heading</h1>
  <p>This is a paragraph.</p>
</body>

</html>

 

0 comments:

Post a Comment