PDA

View Full Version : h1 tags in Opera 6?



31-03-2002, 04:10 PM
Using this code

<h1><p align='center'>Internet Security</h1>

To get the h1 heading in the center of the page.

Looks fine in Mozilla, and IE6. But in Opera6 it is centered but the font is not increased.

JM

31-03-2002, 04:30 PM
JM, try putting the <p> tag on the outside of the <h1> tag

eg:

<p align='center'><h1>Internet Security</h1>

or you could just try using the <center> tag instead of the <p align='center'> but remember to close it (</center>)

31-03-2002, 04:46 PM
<p align='center'><h1>Internet Security</h1>

That results in the heading being in h1 but not centered.

Using the 'center' tag made it look the same as what I had.

thanks anyway

31-03-2002, 07:45 PM
You can't have a <p> inside a <h1>.

It's illogical to have a paragraph inside a heading. Think about it.

Opera thinks that you meant:

<h1></h1>
<p align='center'>Internet Security</p>

More logical than what IE/Moz does.

02-04-2002, 12:15 AM
JM, good to see it works. For interest, there is a 2nd way of doing it:

<center><h1>cat</h1></center>

Note how the tags are nested rather than crossed. You work your way in then go out in the opposite order.

<center><h1>cat</center></h1> is a crossed tag - it appears to work most of the time but fouls up when you least expect it. Avoid at all cost.