Need Help Aligning Content of Span Tags

P

pbd22

Hi.

I am trying to create tabs inside the head tag of an otherwise
blank document. It looks like this:

I am having problems getting the "Tab 1" and "Tab 2" spans to align to
the bottom.

Can somebody tell me how this is done?

Thanks.

<HTML>
<HEAD>
<object align="bottom">
<span id="dyn_tabs">
<span id="tabheader1" style="background-color: #A0CEF8;"
onmouseover="_DisplayTab(1);">Tab 1</span>
<span id="tabheader2" style="background-color: #A0CEF8;"
onmouseover="_DisplayTab(2);">Tab 2</span>
</span>
</object>
</HEAD>
<BODY>
</BODY>
</HTML>
 
J

John Hosking

pbd22 said:
I am trying to create tabs inside the head tag of an otherwise
blank document. It looks like this:

Doesn't look like much to me (I don't actually see *anything*), but that
doesn't surprise me. If you had managed to "create tabs inside the head
tag", what would you suppose they'd look like? Where would we see them?
Would we need special glasses to do so?
I am having problems getting the "Tab 1" and "Tab 2" spans to align to
the bottom.

Of what?
Can somebody tell me how this is done?

My friend, you need to start fresh and obtain an understanding of HTML.
There are many books and online tutorials available, but maybe you could
start with the HTML tutorials at http://www.htmldog.com/, especially
http://www.htmldog.com/guides/htmlbeginner/.

HTH. Good luck.
 
N

Neo Geshel

pbd22 said:
Hi.

I am trying to create tabs inside the head tag of an otherwise
blank document. It looks like this:

I am having problems getting the "Tab 1" and "Tab 2" spans to align to
the bottom.

Can somebody tell me how this is done?

Thanks.

<HTML>
<HEAD>
<object align="bottom">
<span id="dyn_tabs">
<span id="tabheader1" style="background-color: #A0CEF8;"
onmouseover="_DisplayTab(1);">Tab 1</span>
<span id="tabheader2" style="background-color: #A0CEF8;"
onmouseover="_DisplayTab(2);">Tab 2</span>
</span>
</object>
</HEAD>
<BODY>
</BODY>
</HTML>

You appear to fail to grasp the fundamentals concerning html. The only
thing that should belong inside the head element are meta-tags, link
elements and script elements. Style elements, too, but only if the style
affects only that page (multi-page styles *should* be in an external CSS
file). Oh, and the title element, too.

Placing the object element into the head will cause nearly every web
browser out there to ignore it, or to render it incorrectly. Place the
object inside the body element, where it belongs.

Also, why use an object element to contain span elements? The object
element is meant to bring in multimedia, such as flash files and other
*external* files that are meant to be embedded into the web page (in
fact, images are *supposed* to be brought in via the object element,
but IE fails to do it correctly... which is why the img element is still
part of the spec).

Now, if you are looking to create a tabbed interface, there are *much*
better ways of doing it; chiefly with div elements and css:
http://www.cssplay.co.uk/menus/tabmenu.html
http://www.isolani.co.uk/blog/standards/CssTabMenus
http://exploding-boy.com/images/cssmenus/menus.html

Also, I would strongly recommend a DOCTYPE at the head of your document,
preferably HTML 4.01 Strict:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
(Reference: http://www.w3.org/TR/html401/struct/global.html)
This will ensure that you have a *decent chance* of having most
formatting appear similar across most browsers, as it *should* move them
out of quirks mode and into standards-compliance mode.

As a final note, it would also be a *good idea* to use the UTF-8
character set for your documents, because it has a much broader
character set than ISO-8859-1 (US ASCII) and you won’t have to resort to
character codes (http://www.tntluoma.com/sidebars/codes/) to display the
majority of special characters (“&†being the big exception... it *must*
be encoded as &amp; to prevent confusing the browser).

Simply open up each HTML file in Notepad, and “save as†the same file
name, but choose UTF-8 as the character encoding. Simply specifying
UTF-8 in the meta tags won’t be enough, you have to save the files as
UTF-8 as well.

Cheers.
...Geshel
--
*********************************************************************
My return e-mail address is an automatically monitored spam honeypot.
Do not send e-mail there unless you wish to be reported as a spammer.
Please send all e-mail to my first name at my last name dot org, with
a subject-line of “NEWSGROUP REPLY FOR NEO GESHEL†(all uppercase).
*********************************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top