12

Can anyone tell me what is the color code for transparency in CSS like white = "#FFFFFF"? As I am using following code, to convert the color codes into int:

Color color = ColorTranslator.FromHtml(hex);
return (int)((color.R << 16) | (color.G << 8) | (color.B << 0));
Safran Ali
  • 4,477
  • 9
  • 40
  • 57
  • 6
    There is none. The RGB model does not include transparency. There needs to be a fourth channel for it. – Pekka Oct 21 '11 at 15:40
  • Possible duplicate of [Is there a color code for transparent in HTML?](http://stackoverflow.com/questions/18189201/is-there-a-color-code-for-transparent-in-html) – approxiblue Mar 06 '17 at 17:51
  • Yes, there is for certain browsers (new feature). Please, take a look at https://stackoverflow.com/a/60876347/2457251 – Almir Campos Mar 26 '20 at 21:29

11 Answers11

17

There is no hex code for transparency. For CSS, you can use either transparent or rgba(0, 0, 0, 0).

Michael Mior
  • 28,107
  • 9
  • 89
  • 113
13

Or you could just put

background-color: rgba(0,0,0,0.0);

That should solve your problem.

Jarod Moser
  • 7,022
  • 2
  • 24
  • 52
anon
  • 131
  • 1
  • 2
12

how to make transparent elements with css:

CSS for IE:

filter: alpha(opacity = 52);

CSS for other browsers:

opacity:0.52;
Scherbius.com
  • 3,396
  • 4
  • 24
  • 44
7

Simply choose your background color of your item and specify the opacity separatly:

div { background-color:#000; opacity:0.8; }
rob_lowe
  • 151
  • 1
  • 4
4

There is no transparency component of the color hex string. There is opacity, which is a float from 0.0 to 1.0.

CassOnMars
  • 6,153
  • 2
  • 32
  • 47
2

try using

background-color: none;

that worked for me.

p.s.w.g
  • 146,324
  • 30
  • 291
  • 331
tnunes
  • 21
  • 1
0

jus add two zeroes (00) before your color code you will get the transparent of that color

David
  • 11
0

In the CSS write:

.exampleclass {
    background:#000000;
    opacity: 10; /* you can always adjust this */
}
reformed
  • 4,505
  • 11
  • 62
  • 88
marque
  • 11
0

There are now 8-digit hex codes in CSS4 (CSS Color Module Level 4), the last two digit (or in case of the abbreviation, the last of the 4 digits) represents alpha, 00 meaning fully transparent and ff meaning fully opaque, 7f representing an opacity of 0.5 etc.

The format is '#rrggbbaa' or the shorthand, '#rgba'.

Support is lacking for MS browsers, they might be less cooperative or just slower than the other developers, either or both of which actually sealed IE's fate: https://caniuse.com/#feat=css-rrggbbaa

Robert Monfera
  • 1,980
  • 1
  • 22
  • 16
-1

check column name should be renaemed as something name as our wish but coumn should not be check

Ex: check column name should be renamed as language

  • 1
    This doesn't seem to answer the question. Either that or I've horribly failed to understand. – isherwood Feb 02 '22 at 21:47
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/30974682) – skobaljic Feb 08 '22 at 13:20
-2

Simply put:

.democlass {
    background-color: rgba(246,245,245,0);
}

That should give you a transparent background.

dferenc
  • 7,918
  • 12
  • 41
  • 49