Internal p tags causing loss of styling

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
HiddenS3crets
Forum Contributor
Posts: 119
Joined: Fri Apr 22, 2005 12:23 pm
Location: USA

Internal p tags causing loss of styling

Post by HiddenS3crets »

My page has a main <p> tag for an entire body of text, and inside of that text I have another <p> tag. The problem is that everything after the internal <p> (but still inside the main <p> tag) loses its styling.

I took a screen shot of a simple example on the w3schools website.

Here's the link: http://img182.imageshack.us/img182/6469/ssbw0.png

You can see that p.one colors the text red while p.two colors blue. Once I place p.two inside of p.one, I lose styling for text after. Any ideas?
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Internal p tags causing loss of styling

Post by califdon »

I don't think you can nest paragraph tags. Most browsers default to ending a paragraph if it encounters another <p> tag before an ending </p> tag. Old web coders used to be sloppy and omit closing <p> tags. Sloppy, but it works. Actually, you should never want to nest paragraph tags. You should be using some other tag, or you should end one paragraph and begin another.
HiddenS3crets
Forum Contributor
Posts: 119
Joined: Fri Apr 22, 2005 12:23 pm
Location: USA

Re: Internal p tags causing loss of styling

Post by HiddenS3crets »

that seems to make sense, thanks man
Post Reply