-
Not Centering
Good morning (or, for you blokes across the pond, afternoon) folks. Here's my stumper du jour:
The following code is not centering:
Code:
<center><h2>Eviction from Residential Premises</h2></center>
I've tested this in (a very early edition of) Firefox, as well as in relatively up-to-date Google Chrome. w3c testing comes back clean. The page, should anyone care to see it, is http://www.njmarijuana.com/page.php?here=housing.
Comments welcome.
A.
-
In the css file here:
<link rel="stylesheet" type="text/css" href="css/njmarijuana.css" />
you have the h2 heading set as:
h2 { text-align:left; font-size:large; }
Try changing that to center and remove those center tags.
My test page is here:
http://www.web-user.info/test/pot/page.php
It seems to have centered those h2 headings as you were trying to do.
-
That would work but would also center text in all other h2 elements. That may or may not be desirable.
If it's not, you could make up a class in the stylesheet:
Code:
.center {
text-align: center;
}
Then in the markup get rid of the center tags again, and add the class:
Code:
<h2 class="center">Eviction from Residential Premises</h2>
-
Now why didn't I think of that? Problem solved. Thanks, folks.
A.