Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: <span>

  1. #1
    Join Date
    Jul 2005
    Location
    cali
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default <span>

    Ok i have a few questions.

    .:1:. What are the common attributes of <span>?
    .:2:. Is it possible to align the content in a <span> tag without placing it in a div?

    I am sry for asking such basic questions, but i don't frequently use spans, and i dont want to use css to position my text..

    I could not find enough accurate information on the correct attributes/properties.

    .:3:. If there is a better way than to use the <span> tag, please What is it?

    Thank you for any information, also, if you know any good reference sites, please include a url.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    <span> is eqivalent to <a> except that it cannot support an href attribute. The best way to learn what you can and cannot do with <span> is to experiment.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by bubba.daniel
    .:1:. What are the common attributes of <span>?
    As the span element is generic, it has no attributes of its own. Instead, it uses the attributes that are common to virtually every HTML element: id, class, style, title, lang, dir, onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, and onkeyup.

    .:2:. Is it possible to align the content in a <span> tag without placing it in a div?
    Inline, non-replaced elements like span have no concept of width; the box that they create wraps tightly around the content (see the example near the end). As such, alignment is equally meaningless. Text alignment only applies to block-level elements, like p, div, and several others.

    You can style an inline element to format itself like a block-level element, and therefore give it width and align its contents, but that may, or may not, be the best solution - it depends on what exactly you're trying to do.

    I could not find enough accurate information on the correct attributes/properties.
    The HTML specification provides all the information you need. The box at the top is taken from the DTD: the grammar that defines a form of HTML (the different forms are Strict, Transitional, and Frameset). In this case, the attribute list declaration (<!ATTLIST ...>) uses an entity, attrs, to define the supported attributes. This entity expands to three other entities: coreattrs, i18n, and events. If you follow the links to these definitions, you'll see they add up to the list I gave at the start of this post.

    .:3:. If there is a better way than to use the <span> tag, please What is it?
    Maybe, but you haven't clearly stated what you want to do, but merely alluded to positioning some text (and there are numerous ways to do that). Please show an example. What would be really nice is a link to what your markup is now, and a small image showing how you want it to look.


    Quote Originally Posted by jscheuer1
    <span> is eqivalent to <a> except that it cannot support an href attribute.
    An a element defines a link, an anchor, or both (depending on its attributes). A span element defines nothing intrinsically as it's a generic element. They are hardly equivalent - a bad choice of words. Furthermore, there are many attributes that apply to a elements, but not to spans: charset, type, name, href, hreflang, rel, rev, accesskey, shape, coords, tabindex, focus, and blur.

    Mike

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Mike
    Originally Posted by jscheuer1
    <span> is equivalent to <a> except that it cannot support an href attribute.

    An a element defines a link, an anchor, or both (depending on its attributes). A span element defines nothing intrinsically as it's a generic element. They are hardly equivalent - a bad choice of words. Furthermore, there are many attributes that apply to a elements, but not to spans: charset, type, name, href, hreflang, rel, rev, accesskey, shape, coords, tabindex, focus, and blur.
    I knew I should have said 'roughly equivalent'. My meaning being that as far as formatting or layout are concerned, they behave about the same, being inline elements.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jul 2005
    Location
    cali
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ok what i am doing is, making a webpage as you hopefull geussed...
    LOL

    i have the page applied to my liking to where its is fitted inside a window, the only thing is i want to put some content © christforums at the bottom, and i dont want to use breaks or something, someone else told me to use a span, and i couldnt find a way to tell the span to be at the bottom of the page..

    its in a table so... the bottom of the row



    specific enough?
    Last edited by bubba.daniel; 08-01-2005 at 09:28 PM.

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I still don't really get what you want as your image looks like it is written in Arabic, it is so small and of such low resolution. So, I can't say with any certainty, even what I think the best avenue of approach might be. They say a picture's worth 1,000 words but, when it comes to layout, the code is worth 1,000 pictures.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Jul 2005
    Location
    cali
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    LOL, its just squished so it wouldnt take alot of space... the red box is where i want the © christforums to appear... lol, what is some script i could use to make it do that, with in your mind, i have the page to where it goes to size of window. aligned bottom is what i want

  8. #8
    Join Date
    Jul 2005
    Location
    cali
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I would like somone to answre me again please

  9. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Really need to see the code to give any useful advice:

    PLEASE: Include the URL to your problematic webpage that you want help with.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. #10
    Join Date
    Jul 2005
    Location
    cali
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    its not on the web.. lol ill put it here

    www.freewebs.com/christdied/testsite.html
    that is where is will come in D= lol

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
  •