473,545 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5521
>Is it possible to use CSS to prevent the 'Gecko-underline'
behind>'anchore d' 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.p ls> wrote:
Is it possible to use CSS to prevent the 'Gecko-underline'

behind>'anchor ed' 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'sunderli ne, which is "drawn through" -- but not inherited by -- itschildren.Whe n you add a background color to the img it "covers up" thatunderline.I f 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
7259
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 same problem. Internet Explorer 6 and Opera 7 have no problems with it. <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN'...
2
2017
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 presentational markup from the HTML. I've come up with what seems to me to be a fairly nice 3 column page that can handle variable length columns and still...
7
17045
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 wrapps below the first. I can prevent this through the use of overflow: hidden on the containing div tag, but this a css2 style not implemented...
2
1876
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 left-middle blue box ("Seitenleiste") and the lower blue box ("the credits") is double as high as expected. The problem can be fixed by having
6
3218
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 width of the ul is fixed, and I've set the width of the li and a elements to 100%. I've also set a 10px left and right padding to the links, and...
1
1601
by: Marek Mänd | last post by:
How to prevent selecting table cells with CTRL+mouse left click in Gecko based browsers?
6
63034
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() { confirm("close ?");
4
1797
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 fixed and scrolling divs are present on this page... Is this a bug in IE or Gecko? What does the CSS/HTML need to get Gecko to send the second...
0
2135
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 for an application mostly implemented in Python. Ideally, I'd like to somehow come up with a Python module that wraps the Gecko, so that I can: ...
1
1615
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
7486
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...
0
7676
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. ...
1
7442
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7776
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...
1
5347
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...
0
4965
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...
1
1905
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1032
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
729
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...

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.