SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast Ricky's Avatar
    Join Date
    Jan 2004
    Location
    Unknown
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question About paragraph tags

    Hi !


    Is it better to use only [p] opening tags or should the [/p] closing tag be used too, regarding compatibility and general way of doing?

    Thanks in advance!


    Ricky

  2. #2
    SitePoint Zealot
    Join Date
    Jan 2004
    Location
    Holland
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Always close elements!

    (X)HTML container always consist of an opening an a closing tag. Although earlier standards allowed for many of the closing tags to be omitted, newer (XML based) standards do not, which is reason enough to make it a habit of always closing elements with the appropriate closing tag.

    Besides that, even forgiving browsers may sometimes have a hard time to figure out what you had in mind structure-wise; using closing tags tells them exactly, avoiding rendering surprises and potentially slower rendering.

    Finally, closing your container elements properly will help yourself lateron to better understand what document structure you had in mind back in the time you made it.
    Regards,
    Ronald.

  3. #3
    Caveat surfer Buddy Bradley's Avatar
    Join Date
    May 2003
    Location
    Cambridge, UK
    Posts
    2,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Close your paragraph tags, otherwise all the words will fall out.

  4. #4
    SitePoint Zealot Dorsey's Avatar
    Join Date
    Feb 2004
    Location
    NJ
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The last post makes the most sense of all.

  5. #5
    SitePoint Evangelist
    Join Date
    Nov 2003
    Location
    Brisbane, Australia
    Posts
    408
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi

    General rule of thumb is to close all tags that you can and give your code as much information as you can. Don't let the browser guess what you mean - TELL IT WHAT YOU WANT!

    Close everything!

    Also with <p> tags, if you use a stylesheet and add a class to a paragraph it will not stop until it reaches a </p>

    Hope this helps

    M Barnes


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
  •