SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    span class or p class.? which one to use in tables

    hey folks,
    wanted to ask whats the difference between a span tag and p tag generated while typing in tables like i use design view of DW and in back there is code generating like
    Code HTML4Strict:
    <span class="txt">Hello world</span>
    which one to use while having td's to make a form?
    All those who wander aren't lost.

  2. #2
    Mazel tov! bronze trophy kohoutek's Avatar
    Join Date
    Aug 2004
    Location
    Hamburg, Germany
    Posts
    4,248
    Mentioned
    30 Post(s)
    Tagged
    0 Thread(s)
    Why do you need to use an extra element? Couldn't you just use the td element and append a class to it instead?

    Anyway, the difference between a span element and a p element is that the first is an inline element and the latter a block element. Which HTML element to use should depend on what you intend to display content-wise.
    Maleika E. A. | Rockatee | Twitter | Dribbble



  3. #3
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    u mean like <td class=""text>Hello World</td>, yes sure i did but as i said the DW auto generated these span tags so wanted to know what's the difference b.w a paragraph and span
    All those who wander aren't lost.

  4. #4
    Mazel tov! bronze trophy kohoutek's Avatar
    Join Date
    Aug 2004
    Location
    Hamburg, Germany
    Posts
    4,248
    Mentioned
    30 Post(s)
    Tagged
    0 Thread(s)
    You should configure your tool (Dreamweaver) in such a way that it does not generate extra markup. Never use auto-generated markup, especially not auto-generated markup that makes no sense in any which way. My suggestion is to either remove the extra markup manually or code it again by hand.
    Maleika E. A. | Rockatee | Twitter | Dribbble



  5. #5
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Span is a text formatting element.
    P is a structural Element.

    http://reference.sitepoint.com/html/span
    http://reference.sitepoint.com/html/p


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
  •