Set heading text align to center in HTML and CSS
Description
The following code shows how to set heading text align to center.
Example
<html>
<head>
<style type="text/css">
h4 {<!-- w w w . ja va 2 s .c o m-->
margin: 0;
padding: 0;
font-size: 1.25em;
font-weight: bold;
text-align: center;
}
</style>
</head>
<h2>Cross<span>i</span>ng <span>Over</span></h2>
<h4>Gordon (<span>I</span>-Utah) GOP; <br />changes
part<span>i</span>es to be <span>I</span>ndependent</h4>
</body>
</html>
The code above generates the following result.