View Full Version : <span>
bubba.daniel
07-31-2005, 06:45 PM
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? :o
Thank you for any information, also, if you know any good reference sites, please include a url.
jscheuer1
07-31-2005, 08:47 PM
<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.
mwinter
08-01-2005, 12:24 AM
.: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 (http://www.w3.org/TR/REC-CSS2/visuren.html#inline-formatting) (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 (http://www.w3.org/TR/html4/) provides all the information you need (http://www.w3.org/TR/html4/struct/global.html#h-7.5.4). 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? :o 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.
<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
jscheuer1
08-01-2005, 06:15 AM
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.
bubba.daniel
08-01-2005, 09:23 PM
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
http://tinypic.com/9sexir.gif
specific enough?
jscheuer1
08-01-2005, 09:55 PM
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.
bubba.daniel
08-01-2005, 10:33 PM
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
bubba.daniel
08-03-2005, 01:27 AM
I would like somone to answre me again please
jscheuer1
08-03-2005, 02:32 AM
Really need to see the code to give any useful advice:
.
bubba.daniel
08-03-2005, 05:59 PM
its not on the web.. lol ill put it here
www.freewebs.com/christdied/testsite.html
that is where is will come in D= :eek: lol
jscheuer1
08-03-2005, 06:23 PM
OK, for starters, put this right before the </table> tag:
<tr>
<td width="25%" height="100%" bgcolor="FF9933">
</td>
<td width="50%" height="100%" bgcolor="white" valign="top" align="center">Copyright Whoever
</td>
<td width="25%" height="100%" bgcolor="FF9933">
</td>
</tr>I'm still not sure what you are going for but, this has got to be a step in the right direction.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.