Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-05-2012, 11:39 AM   PM User | #1
joelbrandman
New Coder

 
Join Date: Aug 2012
Posts: 10
Thanks: 4
Thanked 0 Times in 0 Posts
joelbrandman is an unknown quantity at this point
Transparent background and text over an image

Can anyone help me by showing me how to achieve this style seen in the following URL,

http://www.bbc.co.uk/food/chicken

I would like to create the style seen in the provided example of an image with a transparent black box along the bottom with text which can be made into a link.(Avoiding using Photoshop)

Thank you.
joelbrandman is offline   Reply With Quote
Old 12-05-2012, 11:48 AM   PM User | #2
donna1
New Coder

 
Join Date: Nov 2012
Location: london
Posts: 55
Thanks: 5
Thanked 1 Time in 1 Post
donna1 can only hope to improve
In javascript there is a rgba function to set colours
the a value is transparency so set that to half of max

dont know if theres the same sort of thing in CSS
donna1 is offline   Reply With Quote
Old 12-05-2012, 12:33 PM   PM User | #3
backa
New Coder

 
Join Date: Oct 2012
Posts: 44
Thanks: 7
Thanked 3 Times in 3 Posts
backa is an unknown quantity at this point
the rgba function exists in css too. rgba(0, 0, 0, .5) will set the colour as black with 50% transparency. the final value set in increments of .1 determines the opacity.
backa is offline   Reply With Quote
Old 12-05-2012, 12:58 PM   PM User | #4
joelbrandman
New Coder

 
Join Date: Aug 2012
Posts: 10
Thanks: 4
Thanked 0 Times in 0 Posts
joelbrandman is an unknown quantity at this point
Thank you, how do I get it to overlay an image though?
joelbrandman is offline   Reply With Quote
Old 12-05-2012, 01:24 PM   PM User | #5
donna1
New Coder

 
Join Date: Nov 2012
Location: london
Posts: 55
Thanks: 5
Thanked 1 Time in 1 Post
donna1 can only hope to improve
in javascript just set that rgba opacity in style before any draw to the canvas and then it does it automatically,
in CSS I think you put opacity:0.5

Last edited by donna1; 12-05-2012 at 01:53 PM..
donna1 is offline   Reply With Quote
Old 12-05-2012, 02:11 PM   PM User | #6
donna1
New Coder

 
Join Date: Nov 2012
Location: london
Posts: 55
Thanks: 5
Thanked 1 Time in 1 Post
donna1 can only hope to improve
Ive just tried it on the hydra example and opacity is not really what I need for games moving over a background
I want surrounding white in the hydra image to be transparent.
Heres the example with a background and opacity of object set to 0.5 you can see the problem - HELP

http://donoi.hostoi.com/hydrabck.html
donna1 is offline   Reply With Quote
Reply

Bookmarks

Tags
css, html, image, text

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:05 AM.


Advertisement
Log in to turn off these ads.