473,385 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to prevent the 'Gecko-underline' behind images in anchors?

Hello CSS-ers,

My question is:
Is it possible to use CSS to prevent the 'Gecko-underline' behind
'anchored' images on pages with patterned background images?

The page http://www.vonreeken.demon.nl/test/gifline1.htm
shows, well if a 'Gecko' browser is used of course, that these
browsers let the background of images inherit the text-decoration
attribute of the containing anchor.

Example code:
<a href="dummy.htm" title="A dead link"><b>Photo Album</b><br>
<img src="book.gif" alt="The content"
style="border-style: none; width: 48px; height: 48px;
vertical-align: middle; "></a>

This results in the 'anchor'-underline being visible in the
transparent part of the book.gif image.

I can imagine that this may officially be correct but I like the way
Opera (7.53) and IE (6.0) handle this better (i.e. never show anchor
/text/-attributes under images).

To see the effect and read additional information, please check the
above page mentioned test page. The page has also a link to an example
page with the code stripped to the minimum is.

Thanks in advance,
a3ano
Jul 20 '05 #1
3 5514
>Is it possible to use CSS to prevent the 'Gecko-underline'
behind>'anchored' images on pages with patterned background images?Sure. I think
it would bea img, a:hover img{ text-decoration: none; }I imagine
Gecko wouldn't underline linked images set to {display: block}, if that's
appropriate to your layout.
Jul 20 '05 #2
On Mon, 11 Oct 2004 01:31:13 GMT, lucy <lu**@no.spam.pls> wrote:
Is it possible to use CSS to prevent the 'Gecko-underline'

behind>'anchored' images on pages with patterned background images?Sure. I think
it would bea img, a:hover img{ text-decoration: none; }I imagine
Gecko wouldn't underline linked images set to {display: block}, if that's
appropriate to your layout.


Thanks for the reply.
I had tried already the 'a img' construction as follows:

<style>
a:link { color: blue; text-decoration: underline; }
a:hover { color: blue; text-decoration: none; }
a img { color: blue; text-decoration: none; }
</style>

(and to rule out cascading sequence issues) also as first in the style
rule list.
But it was not successfull.

The strange inconsistency is that
a img { color: blue; background-color: red; } does results in a
red background below the image but
a img { color: blue; text-decoration: none; } does not result in
not-underlined text below the image.

Another strange inconsistency is that if only an image and no
(non-white space) text is include in the anchor, no text-decoration is
shown.

More information and examples regarding this are available on
page http://www.vonreeken.demon.nl/test/gifline1.htm
Jul 20 '05 #3
>I had tried already the 'a img' construction as follows:[...]> a img { color: blue; text-decoration: none; }Silly me, I wasn't thinking straight.a img { text-decoration: none;} won't do anything because the linkedimage, per se, is not underlined; what you see is the anchor'sunderline, which is "drawn through" -- but not inherited by -- itschildren.When you add a background color to the img it "covers up" thatunderline.If you really want to give the image a patterned background image thatmatches that of the page, you could set the background-attachment forboth to "fixed", so they line up.But in your test example, the easiest would be to set those images to{display: block} instead of using the line break tag <br>

Jul 21 '05 #4

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

Similar topics

15
by: Peter Bremer | last post by:
Hi all, I've written this little piece of code, which doesn't seem to work in Mozilla 1.5. I haven't tried it on other Gecko browsers, but I've found some indication that Netscape 6+ has the...
2
by: AD. | last post by:
Hi all, I'm just playing around with some ideas for cleaning up the HTML/CSS in a web based app of ours. The intention is stop using table layouts, remove all pixel based sizes and...
7
by: PJ | last post by:
I have two img elements in a div tag, the first set up w/ float:left and the second set up w/ float:right. When the browser's window width is less than the total width of the two images second img...
2
by: Rainer Birkenmaier | last post by:
Hi again, This float-thing with IE is really killing me ... anyway here two new questions: 1) Check out http://birkenmaier.org/a.php If you display this using IE the margin between the...
6
by: Prototipo | last post by:
I'm making a CSS menu and I have a problem (yet another "Gecko/IE different behaviour with the same code" problem). This menu uses unordered lists, with li elements that contain hyperlinks. The...
1
by: Marek Mänd | last post by:
How to prevent selecting table cells with CTRL+mouse left click in Gecko based browsers?
6
by: Luke Matuszewski | last post by:
As in topic... has anyone used it ? I tried to use it but i guess i failed... here is a code: <html> <head> <title></title> <script type="text/javascript"> function closedWin() {...
4
by: Number 11950 - GPEMC! Replace number with 11950 | last post by:
When www.geoceanis.com is sent to the print preview or alternatively the printer, the second page is displayed or printed by IE, but lost to Gecko (Netscape, Firefox, Moxilla, etc...). NOTE: Both...
0
by: Kenneth McDonald | last post by:
Sorry for crossposting to several lists, but from what I can tell, what I want to do may involve several different areas of expertise. (None of which I have :-( ) I'd like to use Gecko as the UI...
1
by: Joe P. Cool | last post by:
In 2005 I heard of plans to add Python as a second language to the Gecko engine. Is this still true? Or has this plan been abandoned?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.