If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Oct 2004
    Member #
    here's a silly question; can you have a tag within the same tag: <div> within a <div> or a paragragh in a paragraph?


  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Boston, MA
    Member #
    205 times
    This is called nesting elements, or a parent/child relationship. Some elements (divs, for example), can have other elements as children. Some cannot.

    A <div> can have another <div> as a child. In fact, it can have almost all but a few HTML elements as children. A <p> on the other hand, cannot have another <p> within it. Paragraphs have a sibling relationship. Think of it logically, what is a paragraph? Can you have a paragraph within a paragraph in real life? The only elements that a paragraph can have as children are formatting elements and hyperlinks - span, font, a, b, i, u, etc.

    Hope that makes sense! With time, you'll get used to which elements can be parents/children of others.

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 12:32 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: