Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Feb 2003
    Location
    New York, USA
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Table Background Opacity with Text

    Hello All,

    I have a table that I want to have a colored background. I want the backround to have some opacity to it. I will have text within the cells.

    The problem I am having is that I am able to control the opacity of the background but that also makes the cell text fade too.

    Is there a way to keep the text from being affected by the opacity setting?

    <table width="400" height="300" border="0" bgcolor="#000080"style="-moz-opacity:40%; filter: alpha(opacity=40);">
    <tr>
    <td><b>Test Text</b></td>
    </tr>
    </table>

    Thanks
    NYColt

  • #2
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,742
    Thanks
    0
    Thanked 244 Times in 239 Posts
    Hi there NYColt.

    Obviously the opacity will affect everything
    within the cell. To get round this hurdle try this...
    Code:
    <table><tr>
    <td style="width:400px;height:300px;background-color:#000080;-moz-opacity:40%; filter: alpha(opacity=40);"></td>
    </tr></table>
    
    <span style="position:absolute;top:150px;left:150px;"><b>Test Text</b></span>
    cthead

  • #3
    New Coder
    Join Date
    Feb 2003
    Location
    New York, USA
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Gottcha, basically place the text over the table. hmm didn't think of that.


  •  

    LinkBacks (?)


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •