05-17-2009, 04:16 AM
Is there a website which tells you what other tags are allowed in a parent tag?
For instance, what tags are allowed inside <p></p>? Or What tags are allowed inside <a></a>? etc. etc.
05-17-2009, 09:31 AM
Well, I don’t know of any site specifically telling that but there are general rules:
Block-level elements and table cells can contain other block-level elements and inline elements.
Inline elements can only contain other inline elements.
Paragraphs are a special case of block element: They can only contain inline elements, too.
Forms are block-level elements and can hold anything but input elements can’t be direct children, they must be in some other block-level container (e. g. a. fieldset).
Now you only need to find out what is a block-level element and what an inline element.
05-17-2009, 09:54 AM
Try looking around w3schools.com. The previous post pretty much mentioned everything, but just validate everything time to time to see if theres anything you've missed.
05-17-2009, 03:18 PM
..and there are some special tags like <ul>,<ol>,<li>,<dd>,<dt>,<dd> etc, for which we need to obey some nesting rules. Refer http://htmldog.com/reference/htmltags/ul/ and related links.