[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
  • randall s randallspicher at yahoo.com
    Thu Aug 17 12:07:01 EDT 2006

     

    Jason Gurtz <jason at jasongurtz.com> wrote: 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  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  tag.
    
    So a div is a container (literal box for positioning) that holds things
    like  tags or tables (used for tabular data, NOT positioning!) or
    , or whatever else.
    
    A  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 
    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 
    
    you could do
    
    #myID {
        css-thingy: value;
    }
    
    and use 
    
    Fun fun...
    
    ...Of course, just beware the IE hell of CSS inheritance and vast
    wasteland of positioning bugs!
    
    ~Jason
    
    
    The SPAN tag really is the exact same thing as a DIV, except that it is an inline version rather than a block level element.  It is useful for both applying styles like you mentioned, and for doing dhtml things such as changing text
     
     some stuff <span id=thisthing>some old stuff</span> and more
    
     <script>
     function someaction(){
     thisthing.innerHTML='this is better than the previous text';
     }
     </script>
    
     or you can use it for hiding/showing large (or small) chunks using
     thisthing.style.display='none';
     and 
     thisthing.style.display='inline';
     
     Again, it really is just the inline version of a DIV tag, and is used for all the same purposes when you want to do things inline.
     
     Randall
     		
    ---------------------------------
    Do you Yahoo!?
     Next-gen email? Have it all with the  all-new Yahoo! Mail Beta.
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.eclug.net/pipermail/eclug/attachments/20060817/140e0ecd/attachment.htm 
    

     

     

    More information about the ECLUG mailing list