CSS: <p><h1 /></p>

I have this code that I am trying to validate xHTML 1.0 Transitional

<p><h1>Lorem Ipsum Dolor</h1></p>



<p>Lipsm epse...</p>

The

tag is automatically made by Movable Type, and I want to use

for some bold/centered text. Is there way to fix this or will i have to use :(

#268295

You either have to remove the

or the

.

I'd suggest removing the

and adding an id to the

. That way you can style the id to the same as your h1 tags and it'll validate. Mind you, I'm assuming movable type will let you do this. Otherwise a span is your best bet.

#268297

nope,

is auto added around em i guess i'll have to span it :(

awwww ****. i changed it to a class from h1, but the text-align:center; is not honored.

tags can't be used in

s either :(

#268304

its because the span tag is an inline element, you'll have to stick a

tag around it if you cant put the class on the p tag it's self !

#268555

If you must use a "span" within a paragraph, then make it display as a block element:

<p><span class="SomethingOrOther">Lorem Ipsum Dolor</span></p>

<p>Lipsm epse...</p>

In your style sheet file (you are using a seperate file for your styles, right? :mad: ) give the following attribute to the class:

p span.SomethingOrOther { display: block; text-align: center; }

--

If you are not using seperate files (shame on you) then put this in:

<p><span style="display: block; text-align: center;">Lorem Ipsum Dolor</span></p>

<p>Lipsum epse...</p>

#268702