How to change the opacity (alpha, transparency) of an element in a canvas element?

Using the HTML5 <canvas> element, I would like to load an image file (PNG, JPEG, etc.), draw it to the canvas completely transparently, and then fade it in. I have figured out how to load the image and draw it to the canvas, but I don’t know how to change its opacity. Here’s the code … Read more

How to Set Opacity (Alpha) for View in Android

I have a button as in the following: <Button android:text=”Submit” android:id=”@+id/Button01″ android:layout_width=”fill_parent” android:layout_height=”wrap_content”> </Button> In my onCreate() event, I am calling Button01 like this: setContentView(R.layout.main); View Button01 = this.findViewById(R.id.Button01); Button01.setOnClickListener(this); There is a background in the application, and I want to set an opacity on this submit button. How can I set an opacity for … Read more

Set opacity of background image without affecting child elements

Is it possible to set the opacity of a background image without affecting the opacity of child elements? Example All links in the footer need a custom bullet (background image) and the opacity of the custom bullet should be 50%. HTML <div id=”footer”> <ul> <li><a href=”#”>Link 1</a></li> <li><a href=”#”>Link 2</a></li> <li><a href=”#”>Link 3</a></li> <li><a href=”#”>Link … Read more

How to make blinking/flashing text with CSS 3

Currently, I have this code: @-webkit-keyframes blinker { from { opacity: 1.0; } to { opacity: 0.0; } } .waitingForConnection { -webkit-animation-name: blinker; -webkit-animation-iteration-count: infinite; -webkit-animation-timing-function: cubic-bezier(.5, 0, 1, 1); -webkit-animation-duration: 1.7s; } It blinks, but it only blinks in “one direction”. I mean, it only fades out, and then it appears back with opacity: … Read more

Can you set a border opacity in CSS?

Is there a straight forward CSS way to make the border of an element semi-transparent with something like this? border-opacity: 0.7; If not, does anyone have an idea how I could do so without using images? 1Best Answer 11 Unfortunately the opacity property makes the whole element (including any text) semi-transparent. The best way to … Read more

CSS Background Opacity [duplicate]

This question already has answers here: How do I give text or an image a transparent background using CSS? (33 answers) Closed 5 years ago. I am using something similar to the following code: <div style=”opacity:0.4; background-image:url(…);”> <div style=”opacity:1.0;”> Text </div> </div> I expected this to make the background have an opacity of 0.4 and … Read more

How do I give text or an image a transparent background using CSS?

Is it possible, using CSS only, to make the background of an element semi-transparent but have the content (text & images) of the element opaque? I’d like to accomplish this without having the text and the background as two separate elements. When trying: p { position: absolute; background-color: green; filter: alpha(opacity=60); opacity: 0.6; } span … Read more