HTML style have various uses. We can change the text color ,Text Alignment , Text Size,font style by the use of this attribute.
<html>
<body>
<h1 style="text-align:left">Left Heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
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>
<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>
<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
<body>
<h1 style="text-align:left">Left Heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
0 comments:
Post a Comment