Results 1 to 2 of 2

Thread: Help with CSS

  1. #1

    Help with CSS

    I have a transparant content box, but I want the text to remain black. I also want the .banner class to be aligned at the absolute top and left.

    Code:
    body
    {
    background-color: #dcf1c1;
    background-image: url('images/layout/background_tile.png');
    background-repeat: repeat-x;
    }
    .banner
    {
    background-image: url('images/layout/banner_tile.png');
    background-repeat: repeat-x;
    width: 100%;
    }
    .content
    {
    background-color: #ffffff;
    opacity: 0.15;
    -moz-opacity: 0.15;
    filter: alpha(opacity=15);
    width: 85%;
    height: 100%;
    }
    .text
    {
    color: #000000;
    opacity: 1;
    -moz-opacity: 1;
    filter: alpha(opacity=100);
    }
    .text a, a:link, a:active
    {
    color: #000000;
    font-weight: bold;
    font-style: italics;
    }
    .text a:hover
    {
    color: #000000;
    font-weight: bold;
    }
    .text a:visited
    {
    color: #000000;
    font-style: italics;
    }

  2. #2
    Join Date
    Feb 2006
    Location
    Salisbury UK
    Posts
    4,332
    The banner posuition should be controlled by adding position: absolute; top: 0; left: 0;

    The black text in the transparent box is a little more difficult because opacity affects everything in a div including text and including all divs contained in the outer div. Elements inside cannot return to an opacity of 1.0, they always inherit the opacity value.

    However, you can have one div with transparency (opacity) and another div with no opacity (black text) positioned over the top of it.

    See item 3c here:-
    http://www.wickham43.supanet.com/tutorial/opacity.html
    Code downloaded to my PC will be deleted in due course.
    WIN7; IE9, Firefox, Opera, Chrome and Safari for Windows; screen resolution usually 1366*768.
    Also IE6 on W98 with 800*600 and IE8 on Vista 1440*900.

Similar Threads

  1. CSS and PHPBB Help
    By e3_host in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 01 Sep 2006, 01:47 AM
  2. Problems Positioning with CSS
    By kirstybandm in forum Web Design, HTML Reference and CSS
    Replies: 0
    Last Post: 17 Jan 2006, 05:33 AM

Posting Permissions

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