Need Help Aligning Content of Span Tags

Discussion in 'HTML' started by pbd22, Apr 24, 2007.

  1. pbd22

    pbd22 Guest

    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>
     
    pbd22, Apr 24, 2007
    #1
    1. Advertising

  2. pbd22

    John Hosking Guest

    pbd22 wrote:
    >
    > 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.
    --
    John
     
    John Hosking, Apr 24, 2007
    #2
    1. Advertising

  3. pbd22

    Neo Geshel Guest

    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).
    *********************************************************************
     
    Neo Geshel, Apr 24, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fulio Open

    Can span include span?

    Fulio Open, Jun 26, 2009, in forum: HTML
    Replies:
    5
    Views:
    560
    dorayme
    Jun 26, 2009
  2. Stéphane Klein
    Replies:
    2
    Views:
    1,807
    John Nagle
    Mar 30, 2010
  3. Stefan Behnel
    Replies:
    0
    Views:
    492
    Stefan Behnel
    Mar 29, 2010
  4. Dan Bishop

    DataGrid (body only) contained in <span>...</span> tags

    Dan Bishop, Jun 7, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    291
    Kilic Beg
    Jun 7, 2004
  5. Wang, Jay
    Replies:
    5
    Views:
    488
    Wang, Jay
    May 25, 2004
Loading...

Share This Page