473,799 Members | 3,822 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sample transparency w/ selection color?


Dear Experts: I am trying to write a css style that makes text [a]
invisible; [b] visible-when-selected (so that at least a visible block
appears over the selected text---like black foreground over black
background with 50% opacity to make it gray and shine through what is
behind it). Similarly, I want to be able to shows links as blocks
(like red on red with opacity 20%).

I am trying firefox 1.5.0.9 and konqueror 3.5.5. I presume the latter
is so non-compliant that I may as well not bother. Alas, I thought the
former was pretty decent. yet, I can get my text to be invisible, but
it does not become visible when selected. (cursor changes, so I know I
am selecting. I can also change the opacity level to 0.2 to illustrate
this.) I am enclosing a short example.

Is there a standard way to make this work, preferably under both
firefox and IE, at least latest versions? help appreciated. I have
been pulling my hair out for 3 days now trying to make this work.

sincerely, /ivo welch
<html>
<style type="text/css">
a { color:red; background-color:blue; opacity:0.9; }
p.invisible { font-size:18; opacity:0.0; foreground-color:blue;
background-color:white; font-family:arial; }
::-moz-selection { background:red; color:red; opacity:0.5; }
::selection { background:red; color:red; opacity:0.5; }
</style>

<body bgcolor="cyan">
<div style="width:50 1px; height:203px; background-color:yellow"</div>
<!-- yellow is just an example; this would more usually be a n image
file -->
<p class="invisibl e" style="position :absolute; top:43px;
left:72px">This is an example of some text</a>
<p class="invisibl e" style="position :absolute; top:84px;
left:72px">Will <a href="http://www.omnipage.co m">Omnipage</aever be
able to parse this?</a>
</body>
</html>

Dec 27 '06 #1
2 3962
On 2006-12-27, iv****@gmail.co m <iv****@gmail.c omwrote:
>
Dear Experts: I am trying to write a css style that makes text [a]
invisible; [b] visible-when-selected (so that at least a visible block
appears over the selected text---like black foreground over black
background with 50% opacity to make it gray and shine through what is
behind it). Similarly, I want to be able to shows links as blocks
(like red on red with opacity 20%).

I am trying firefox 1.5.0.9 and konqueror 3.5.5. I presume the latter
is so non-compliant that I may as well not bother.
Its compliance is pretty good, but it doesn't support opacity which you
need for this test.

Surprisingly it does seem to support ::selection. Both that and opacity
are from CSS 3. Most of us are still on CSS 2.1.
Alas, I thought the former was pretty decent. yet, I can get my text
to be invisible, but it does not become visible when selected.
It goes to background and foreground colours both red, which it looks
like it should (Firefox 1.5).
(cursor changes, so I know I am selecting. I can also change the
opacity level to 0.2 to illustrate this.) I am enclosing a short
example.
I had to fix a couple of things in your example: you should use </pto
close <p>, not </a>, and you should put the <stylein a <headelement.

If I add a::selection and a::-moz-selection to the styles, those are
applied by Konqueror to the <awhen it's selected, so I can give it a
sensible foreground colour and make the text visible, which I think is
the effect you want. This doesn't work properly in Firefox.
Is there a standard way to make this work, preferably under both
firefox and IE, at least latest versions?
All this is CSS 3 which is skating on thin ice. No standard exists for
CSS 3. Even CSS 2.1 isn't a standard (only a "draft specification" or
something), but in practice it's fairly well-supported and also a pretty
thorough and unambiguous spec to work to.

CSS 2.1 has no concept of "selection" , on my machine the selection is
styled according to my desktop settings, not even browser configuration.
Dec 27 '06 #2

dear Ben: thank you for the advice. yes, my html code was pretty
lousy. alas, if I understand you right, the current state of affairs
means that I don't stand a chance to make this work for now in either
firefox (missing selection support) or konqueror (missing transparency
support). I have to find a machine with IE 7 next to try out if it
could work there. sigh...I thought I would never want to use IE again,
but if it has both opacity and selection support, this would work.

Alternatively, I guess I will try placing the image atop the text next.
maybe I will get luckier this way. don't see many other choices...

regards

/iaw
Ben C wrote:
On 2006-12-27, iv****@gmail.co m <iv****@gmail.c omwrote:

Dear Experts: I am trying to write a css style that makes text [a]
invisible; [b] visible-when-selected (so that at least a visible block
appears over the selected text---like black foreground over black
background with 50% opacity to make it gray and shine through what is
behind it). Similarly, I want to be able to shows links as blocks
(like red on red with opacity 20%).

I am trying firefox 1.5.0.9 and konqueror 3.5.5. I presume the latter
is so non-compliant that I may as well not bother.

Its compliance is pretty good, but it doesn't support opacity which you
need for this test.

Surprisingly it does seem to support ::selection. Both that and opacity
are from CSS 3. Most of us are still on CSS 2.1.
Alas, I thought the former was pretty decent. yet, I can get my text
to be invisible, but it does not become visible when selected.

It goes to background and foreground colours both red, which it looks
like it should (Firefox 1.5).
(cursor changes, so I know I am selecting. I can also change the
opacity level to 0.2 to illustrate this.) I am enclosing a short
example.

I had to fix a couple of things in your example: you should use </pto
close <p>, not </a>, and you should put the <stylein a <headelement.

If I add a::selection and a::-moz-selection to the styles, those are
applied by Konqueror to the <awhen it's selected, so I can give it a
sensible foreground colour and make the text visible, which I think is
the effect you want. This doesn't work properly in Firefox.
Is there a standard way to make this work, preferably under both
firefox and IE, at least latest versions?

All this is CSS 3 which is skating on thin ice. No standard exists for
CSS 3. Even CSS 2.1 isn't a standard (only a "draft specification" or
something), but in practice it's fairly well-supported and also a pretty
thorough and unambiguous spec to work to.

CSS 2.1 has no concept of "selection" , on my machine the selection is
styled according to my desktop settings, not even browser configuration.
Dec 28 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3872
by: Mr. x | last post by:
Hello, I would like that my image's background color will be transparent. What I have is only paintbrush. My image is *.jpg format (I have tried to save it as *.gif format, and I got less quality), and I don't know how to make the background. In every tool I open the image (html, flash, etc...) I see the original background color, and not the transparent color.
20
4527
by: Nathan Sokalski | last post by:
I am trying to create graphics with GDI+ that include transparency. However, the transparency never seems to show up, even though my colors have an alpha value of 0. How can I generate a graphic that is completely transparent in certain areas (so that the web page background shows through)? I save my graphics as gif files. I would appreciate, if possible, a simple example so that I can see the code. Thanks. -- Nathan Sokalski...
2
13537
by: Mikey | last post by:
Sample VB .NET source code to create mailing labels or customized letters using MS Word MailMerge This VB .NET source code will start MS Word and call methods and set properties in MS Word to execute a MailMerge to create mailing labels or customized letters. A label name known to MS Word MailMerge mailing label wizard may be used or a template file containing the field names Line1 thru Line5 for each record to be printed. If a...
5
2282
by: jordi | last post by:
I need the random.sample functionality where the population grows up to long int items. Do you know how could I get this same functionality in another way? thanks in advance. Jordi
6
3655
by: tommaso.gastaldi | last post by:
In a previous post I have been asking about a way to test Alpha Transparency. Bob and Michael have kindly provided some ideas. Here I would like to share the function I have prepared, for the purpose to improve it. Frankly, I am not clear about the exact meaning of some pixel format (max, gdi, etc.) and I hope I have put them under the right "case". I have made only some superficial test and it seems to work. Note that the purpose is...
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9543
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10488
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10029
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9077
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7567
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6808
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5588
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.