h tags error

Posted in: Newspaper
Post count: 28

Hi Everyone.. I just updated to 2.1 and now i am having an issue inside the visual editor. When I try to add any h tags to my text it creates an h tag around the entire sentence. If I manually add it to the area I want in the text editor and then tab back to the visual editor it changes the placement of the h tag to include the whole sentence again.

So far it is only doing it with the h tags that I have tested. Other elements such as bold and italics are working fine.

Anyone have similar issues and know how to fix?

example:
Places I have been: Australia, Alaska, Arkansas, Colorado, Louisiana, Montana, Texas, Florida, and Mexico.

Try to add h2 tag to “Places I have been:” but it adds the h2 tag to the entire sentence.

If I code it manually the way i want it… it changes it when I go back to the visual editor.

any advice would be appreciated. thanks!!!
William

Post count: 9544

I think WP over-rides that as it’s not semantically correct to have <h2> tags inside of a <p> tag. So, a “block level” element like a sentence generally is itself either a <p> or <h> level element, based on my own experience (meaning a “headline” doesn’t go inside of another block level element – you can’t have an <h2> inside an <h1> or a <p> inside a <h2> technically.)

<h2>BLOCK <h3 (NO!)>OF</h3> TEXT</h2>
<p>Block of text</p>

Likely you have to do that with a span.

So you might have

<h2>My headline here <span class="h2like">larger</span> is from <span class="h2like">Mars</span>, not Venus</h2>

Try making a CSS span for the size change inside a block level element. I had to do this for a flush right “about this book serial” element, since you can’t have a <div> inside a <p> either. <span> is the right way to do stuff inside other stuff with CSS3/HTML5 now.

  • This reply was modified 12 years by simchris.
Post count: 28

ok cool.. thanks for the info… I will test it out.

Appreciate the time.
William

Post count: 3343

Hello,
Work only in classic editor http://screencast.com/t/bclXuIon32
If you want to have the text on the same line follow the @Christopher solution

Thanks

Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.