+ Reply to Thread
Results 1 to 7 of 7

Thread: CSS Opacity & Text help

  1. #1
    mikel2k3 is offline x10 Lieutenant mikel2k3 is an unknown quantity at this point
    Join Date
    Aug 2005
    Location
    West Yorkshire - UK
    Posts
    374

    CSS Opacity & Text help

    Right, this may of been asked before, but ive been looking around and cant really find exactly what I need.

    So does anybody know of a way that I can make a background colour of a div box opaque, while keeping the text inside of it fully visible?

    At the moment, all my text and images inside of the div become opaque too, which is just a bit useless really.

    All help muchly apreciated
    -----------------------------------
    -----------------------------------

    http://www.DistrasDesigns.com

    -----------------------------------
    -----------------------------------

  2. #2
    Jake's Avatar
    Jake is offline Developer Jake is an unknown quantity at this point
    Join Date
    Apr 2005
    Location
    Winona, MN
    Posts
    2,084

    Re: CSS Opacity & Text help

    Have you tried setting the opacity of a paragraph tag, or a span tag or even another div tag inside of the one with opacity on it? Never had to do anything like this but that seems like a place to start.
    Jake Omann | Developer
    █ 888-X10-9668 - jake[@]x10hosting.com
    x10Hosting - Giving Away Hosting Since 2004
    Premium Hosting | VPS Services

  3. #3
    mender42's Avatar
    mender42 is offline x10Hosting Member mender42 is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    42

    Re: CSS Opacity & Text help

    Try fudging the css with something like:

    background-color: somecolor....;
    filter:alpha(opacity=50);
    -moz-opacity:0.5;
    opacity:0.5;

    leaving font colors and weights to what you have normally.....

    Say for a menu something like:

    menu, .ssmenu {
    background-color:#ddffdd;
    color:black;
    font-size:12px;
    font-weight:bold;
    border:1px solid #EFB;
    padding:1px;
    filter:alpha(opacity=75);
    -moz-opacity:0.75;
    opacity: 0.75;
    width:15em;
    margin:1em;
    }

    Uh play with it?

  4. #4
    bonbon is offline x10Hosting Member bonbon is an unknown quantity at this point
    Join Date
    Aug 2007
    Posts
    67

    Re: CSS Opacity & Text help

    Hmm..suggestion.. It is better to choose colors to text who are strong to viewer's eyes and a not bigger siize in font matching with a light background

  5. #5
    mikel2k3 is offline x10 Lieutenant mikel2k3 is an unknown quantity at this point
    Join Date
    Aug 2005
    Location
    West Yorkshire - UK
    Posts
    374

    Re: CSS Opacity & Text help

    Hmm im still struggling with this a little...
    I get the feeling im going to have to scrap the design, but ahh well... Guess its what im limited to really.

    Any images or text that go into the box are also opaque, which really sucks.

    Ill try and get the layout done without the transparency.
    Thanks anyway guys
    -----------------------------------
    -----------------------------------

    http://www.DistrasDesigns.com

    -----------------------------------
    -----------------------------------

  6. #6
    konekt's Avatar
    konekt is offline x10 Sophmore konekt is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    100

    Re: CSS Opacity & Text help

    Quote Originally Posted by mikel2k3 View Post
    Hmm im still struggling with this a little...
    I get the feeling im going to have to scrap the design, but ahh well... Guess its what im limited to really.

    Any images or text that go into the box are also opaque, which really sucks.

    Ill try and get the layout done without the transparency.
    Thanks anyway guys
    This might be a little crude, but, it is a solution. Place your transparent element on the page. Then, set your text on a seperate <div> element (NOT within the transparent element) and set its position to be on top of the transparent element.

  7. #7
    Jake's Avatar
    Jake is offline Developer Jake is an unknown quantity at this point
    Join Date
    Apr 2005
    Location
    Winona, MN
    Posts
    2,084

    Re: CSS Opacity & Text help

    That would work, just make sure to use relative positioning, NOT absolute!
    Jake Omann | Developer
    █ 888-X10-9668 - jake[@]x10hosting.com
    x10Hosting - Giving Away Hosting Since 2004
    Premium Hosting | VPS Services

+ Reply to Thread

Similar Threads

  1. Hybrid's HTML Lessons
    By Hybrid in forum Tutorials
    Replies: 18
    Last Post: 11-28-2009, 02:12 PM
  2. BB Code Guide
    By Jober68 in forum Tutorials
    Replies: 1
    Last Post: 01-10-2008, 05:12 PM
  3. What is Authentication
    By asadislam78 in forum Computers & Technology
    Replies: 1
    Last Post: 12-13-2007, 07:13 AM
  4. Replies: 1
    Last Post: 11-05-2007, 06:07 PM
  5. |PS|*Blur text Tutorial*
    By |Born2Shoot| in forum Tutorials
    Replies: 7
    Last Post: 06-04-2005, 10:53 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
x10hosting free hosting for the masses
dedicated servers