Reply to Re: Need Help Aligning Content of Span Tags

Your name:

Reply:


Posted by Neo Geshel on 04/24/07 17:16

pbd22 wrote:
> 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).
*********************************************************************

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация