HTML Text Align
HTML Tutorial » HTML Text Align
We can Text Align as:
Inline - by using the style attribute in HTML elements
Internal - by using a <style> element in the <head> section
External & External - by using an external CSS file as style.css
The HTML style attribute has the following syntax:
Syntax:
Inline Syntax - <tagname style="text-align: left|right|center|justify|initial|inherit;">Your HTML Text </tagname>
External & External - text-align: left|right|center|justify|initial|inherit;
Adding HTML Text Align using CSS inline - examples
Example:
Example 1 HTML Text Align using CSS inline - examples:
<!DOCTYPE html>
<html>
<head>
<title>HTML Text Align using CSS inline - examples</title>
</head>
<body>
<h1>HTML Text Align using CSS inline </h1>
<span style="text-align: center;">Your text-align:center; using CSS inline</span>
<p style="text-align: right;">example - Your text-align:right; using CSS inline</p>
<p style="text-align: left;">Example - Your text-align:left using CSS inline</p>
<p style="text-align: justify;">Example - Your text-align: justify; using CSS inline</p>
</body>
</html>
Note: You will learn more about CSS Style under css-tutorial.html in this tutorial.
Adding HTML Text Align using CSS internal - examples
Example:
Example 2 Text Align left, center, right using CSS internal - examples:
<!DOCTYPE html>
<html>
<head>
<title>Text Align left, center, right using CSS internal - examples</title> <style>
span {
text-align: center;
}
p {
text-align: right;
}
.text {
text-align: left;
}
</style>
</head>
<body>
<h1>Types of adding Adding HTML Text Size using CSS internal - examples</h1>
<span>Example - This is my HTML Text left align using internal CSS style</span>
<p>Example - This is my HTML Text center align using internal CSS style</p>
<div class="text">example - This is my HTML Text right align using internal CSS style</div>
</body>
</html>
For external CSS style just make a file as style.css and replace
<style>
span {
text-align: center;
}
p {
text-align: right;
}
.text {
text-align: left;
}
</style>
with <link rel="stylesheet" href="style.css" type="text/css"/>
HTML Text Align center, left, right, tag
HTML Text Align - html tutorial
Online Editor
This tool makes it easy to create, adjust, and experiment with custom colors for the web.
HTML Templates

Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.
CSS HTML Layout

Find here examples of creative and unique website layouts.
Free CSS HTML Menu

Find here examples of creative and unique website CSS HTML menu.