Learn HTML code for paragraphs and headings tutorial.
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
This is a paragraph.
'h1' defines the most important heading. 'h6' defines the least important heading.
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>
</body>
</html>
The CSS text-align property defines the horizontal text alignment for an HTML element:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1 style="text-align:center;">Centered Heading</h1>
<p style="text-align:center;">Centered paragraph.</p>
</body>
</html>
Centered paragraph.
The HTML 'b' element defines bold text, without any extra importance. The HTML 'strong' element defines text with strong importance. The content inside is typically displayed in bold.
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<b>This text is bold</b>
<strong>This text is important!</strong>
</body>
</html>
The HTML 'i' element defines a part of text in an alternate voice or mood. The content inside is typically displayed in italic.
The HTML 'em' element defines emphasized text. The content inside is typically displayed in italic.
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<i>This text is italic</i>
<em>This text is emphasized</em>
</body>
</html>