Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Banned
    Join Date
    Sep 2011
    Posts
    140
    Thanks
    17
    Thanked 0 Times in 0 Posts

    Would love advice from ULTRA HTML experts

    Does it really matter wether or not I use DIV or SPAN? I am getting exactly the same outcome using both of them and pages are validating the same.

  • #2
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,928
    Thanks
    46
    Thanked 203 Times in 202 Posts
    div is a block level element "container" and span is an inline element "container" ... what context are you using it in?

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • #3
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,928
    Thanks
    46
    Thanked 203 Times in 202 Posts
    see here for reference

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • #4
    Banned
    Join Date
    Sep 2011
    Posts
    140
    Thanks
    17
    Thanked 0 Times in 0 Posts
    Positioning text and a replacement for single tables.
    Figured I can just use <DIV></DIV> instead of <TABLE><TR><TD></TD></TR></TABLE>
    The result is identical, hence my question.
    Last edited by Democrazy; 09-16-2011 at 05:14 PM.

  • #5
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,338
    Thanks
    5
    Thanked 363 Times in 360 Posts
    Quote Originally Posted by Democrazy View Post
    Positioning text and a replacement for single tables.
    Figured I can just use <DIV></DIV> instead of <TABLE><TR><TD></TD></TR></TABLE>
    The result is identical, hence my question.
    You should ALWAYS be using <div> instead of <table> unless you need to display columnar data. Tables for page layouts are outdated and discouraged.
    Teed

  • #6
    Banned
    Join Date
    Sep 2011
    Posts
    140
    Thanks
    17
    Thanked 0 Times in 0 Posts
    Excellent! Thanks!

  • #7
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,338
    Thanks
    5
    Thanked 363 Times in 360 Posts
    You can read more about why tables for layouts are bad.
    Teed


  •  

    Posting Permissions

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