Results 1 to 5 of 5

Thread: Span vs. Div

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Location
    Forest
    Posts
    545

    Span vs. Div

    Aren't these two tags the same?
    Bird of Prey

    Mr. Bald Eagle.
    [img][/img]

  2. #2
    Fanatic Member cpradio's Avatar
    Join Date
    Apr 2002
    Posts
    616
    <span> is for spanning inline text and div is a replacement for the <p> tag.

    Example:
    Code:
    This is <span style="color:red">spanning text</span>, see how this works?
    Example:
    Code:
    <div style="border:1px">This is is a paragraph of text.<br>
    This works like the <p> except its can interact with javascript by using dhtml.</div>
    http://cpradio.net/
    Administrator @ WDForums and a Moderator @ WebXpertz City Forums

  3. #3
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    This needs to be in the FAQ.

    Span is inline, div is block. I wouldn't say that div is a replacement for p. The p block will wrap around floats. I think that is an inline box attribute.

    'Course, you can redefine everything with the CSS.
    Travis, Kung Foo Journeyman
    As always, RTFM.

    WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
    Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
    YBMS, but Mozilla doesn't.

  4. #4
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    I think CSS actually defines all tags as inline until that gets overidden by the UA's default style sheet.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Location
    Forest
    Posts
    545
    Thanks!
    Bird of Prey

    Mr. Bald Eagle.
    [img][/img]

Posting Permissions

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



Click Here to Expand Forum to Full Width