SitePoint Sponsor

User Tag List

Results 1 to 12 of 12

Thread: empty element!

  1. #1
    SitePoint Zealot
    Join Date
    Jun 2010
    Location
    CA
    Posts
    157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    empty element!

    hi all!
    I am new to website development and i am learning HTML. when i was reading about it; i come to know this term EMpty element but it is not defined properly.

    I wonder if you could explain that to me?
    Thanks

  2. #2
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Element types that are designed to have no content are called 'empty' elements.

  3. #3
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,097
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    Examples include (but are not limited to) a line break, <br> and a horizontal rule, <hr>
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  4. #4
    Sploghm bronze trophy Victorinox's Avatar
    Join Date
    Nov 2008
    Posts
    749
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    For refs, see the Elements section of the W3 spec for HTML 4.01 (Empty elements are marked by an E).

    Differences in XHTML 1.0.

  5. #5
    SitePoint Zealot
    Join Date
    Jun 2010
    Location
    CA
    Posts
    157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks a lot for your help

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,323
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    I guess you could also add elements that are not technically 'empty' elements, but which have been left empty by the author, such as an empty <p></p> element. But in this case it's not a class of element so much as the state of an element. (I just made that up, but it sounds cool. )

  7. #7
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    I guess you could also add elements that are not technically 'empty' elements, but which have been left empty by the author, such as an empty <p></p> element. But in this case it's not a class of element so much as the state of an element. (I just made that up, but it sounds cool. )
    This is why HTML now calls <br> and friends for "void" elements.
    Simon Pieters

  8. #8
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,323
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by zcorpan View Post
    This is why HTML now calls <br> and friends for "void" elements.
    I also wondered where the term "replaced" elements fits in, for things like images. Is it technical term or not, as it wasn't included in Victorinox's link above?

  9. #9
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    I also wondered where the term "replaced" elements fits in, for things like images. Is it technical term or not, as it wasn't included in Victorinox's link above?
    Replaced elements is a CSS term, not an HTML term. See:

    http://reference.sitepoint.com/css/replacedelements
    http://www.w3.org/TR/CSS21/conform.h...placed-element
    http://www.w3.org/TR/CSS21/visudet.html
    Simon Pieters

  10. #10
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,323
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    Ah thanks. I should have looked it up first.

  11. #11
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    The terms empty element and void were discussed a while back in this thread.

  12. #12
    SitePoint Zealot
    Join Date
    Jun 2010
    Location
    CA
    Posts
    157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks once again for such a deep help. i would never have done that myself.. you do not know me


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •