Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8321487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:02:08+00:00 2026-06-08T23:02:08+00:00

I have an HTML table with an object element and a span tag inside

  • 0

I have an HTML table with an object element and a span tag inside one td parent tag like so:

HTML:

<table class="tableClass">
<tr>
<td class="tdClass"><object data="http://mydata.com"></object><span>My Text</span></td>
</tr>
</table>

Now the table has a background color of #999. Basically, with z-indexing, I want the element to hide behind the element, but the span element should be on top of the #999 table background. How do I achieve this?

My CSS:

.tableClass{
  background: #999;
}
.tdClass object{
  z-index:999;
}

.tdClass span{
  position: absolute;
  z-index: 1; (if I make it -1, it disappears behind the table background...)
}

Currently the span element with the text is on top of the object element…I want it behind the object element and infront of the table background.

Thank You

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T23:02:09+00:00Added an answer on June 8, 2026 at 11:02 pm

    .tdClass object needs at least position:relative, as z-index will only work on block-level elements which aren’t position:static. Try the following:

    .tableClass{
      background: #999;
    }
    .tdClass object{
      position:relative;
      z-index:999;
    }
    
    .tdClass span{
      position: absolute;
      z-index: 1;
    }
    

    See also CSS2.1: 9.9.1 Specifying the stack level: the ‘z-index’ property:

    For a positioned box, the ‘z-index’ property specifies:

    1. The stack level of the box in the current stacking context.
    2. Whether the box establishes a stacking context.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an HTML table like: <div> <table border=1> <thead> <tr class=example> <th> <span
I have a HTML table like this: <table> <tr><td>X</td><td>X</td><td class='latest order1'>X</td><td class='latest order4'>X</td></tr> <tr><td>X</td><td>X</td><td
see fiddle i have html table and one textbox and one button.make cell selection
I have a html table like this: Invoice# Due Date Balance Select 12345 12/25/2011
I have this html table: <table class=table-all> <tbody> <tr> <td>BISFENOLO</td> <td>Bisfenolo-AF 10/10</td> <td class=right>€
I have an html table with one of the headers spanning over 2 columns.
i have an html table inside a form in an asp.net mvc view. I
I have the following CSS: html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td { background: transparent; border: 0; font-size: 100%; margin:
I have a table row which has class='highlightedrows' within my html I am trying
I've HTML like that: <div> <table> </table> <div> </div> </div> In JavaScript I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.