[Eclug] OT: What is up with the span tag

  • Previous message: [Eclug] OT: What is up with the span tag
  • Next message: [Eclug] OT: What is up with the span tag
  • Jason Gurtz jason at jasongurtz.com
    Wed Aug 16 23:12:35 EDT 2006

     

    On 8/16/2006 20:51, David Krings wrote:
    > So, all of you wise men and women, can someone explain to me in simple 
    > terms why the SPAN stuff fails and what this SPAN stuff is about anyhow 
    > (yea, I read too many of Bob Pease's columns).
    
    Yea, what the other Dave said...
    
    As you found out, the <span> is not neccesary.  I did a little reading
    up on it since I'm really not up on modern xhtml so much.  I guess it is
    sort of an opposite of the <div> tag.
    
    So a div is a container (literal box for positioning) that holds things
    like <p> tags or tables (used for tabular data, NOT positioning!) or
    <img>, or whatever else.
    
    A <span> on the other hand is an inline element used to apply styles (I
    would guess typically text).  For example, maybe you have an extended
    quotation inside of a paragraph of regular text.  Convention is to
    indent the whole quotation and seperated by a blank line at top and
    bottom of quoted text.  so you could wrap that quoted text with a <span>
    to do that
    
    Another way to do styles is where you use id= instead of class=  I'm not
    sure why but probably has to do with doing dhtml stuff with ECMAscript
    and whatnot
    
    So whereas you'd see
    
    span.myClass {
        stuff: value;
    }
    
    and use <span class="myClass">
    
    you could do
    
    #myID {
        css-thingy: value;
    }
    
    and use <span id="myID">
    
    
    Fun fun...
    
    ...Of course, just beware the IE hell of CSS inheritance and vast
    wasteland of positioning bugs!
    
    ~Jason
    
    -- 
    
    

     

     

    More information about the ECLUG mailing list