473,508 Members | 2,475 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cancelling a link border when link applied to an image


Tricky one this...
Basically I have a link style:
a {border: 1px solid gray}

but I don't want the border added when a link is applied to an image, i.e.
<a href="#"><img src="foo.jpg"></a>

Neither of:
a img, img a {border: 0;}
will work, for the reasons given in
https://bugzilla.mozilla.org/show_bug.cgi?id=303564
Here's an example page showing the code:
http://tinyurl.com/bx82d

Can anyone suggest a way of achieving this?

Martin
Aug 5 '05 #1
1 1510
Els
Martin Lucas-Smith wrote:
Tricky one this...

Basically I have a link style:
a {border: 1px solid gray}

but I don't want the border added when a link is applied to an image, i.e.
<a href="#"><img src="foo.jpg"></a>

Neither of:
a img, img a {border: 0;}
Of course not.
"a img" is the image inside the <a> element, which doesn't have a
border. It's the <a> element that has the border.
"img a" is the <a> element inside the image, which seems impossible to
me.
will work, for the reasons given in
https://bugzilla.mozilla.org/show_bug.cgi?id=303564
That's an invalid bug report.
Here's an example page showing the code:
http://tinyurl.com/bx82d

Can anyone suggest a way of achieving this?


You could give every <a> that holds an <img> a class to indicate that,
and set
a.class{border-bottom:none;}
in your styles.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Nick Lowe - Sound Of Breaking Glass
Aug 5 '05 #2

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

Similar topics

1
3267
by: j erickson | last post by:
with the following xsl and xml file, the display of the gif file with the <image/url> tag works. However, the gif file in the <description> tag using the name attribute "src" won't make the correct...
33
27703
by: Thomas Mlynarczyk | last post by:
Hi, I'm looking for a way to put a 1px solid border around the image in this link: <a href="some.html"><img src="some.gif"></a> Well, that, by itself, is simple. However, I would like to have a...
7
5848
by: Greg Raven | last post by:
I styled my links just the way I want them using CSS, but now my linked images have picked up these same styles. I've tried turning the styles off for the images with: a img { text-decoration:...
2
1986
by: Lars Forslin | last post by:
I have a problem with making image hyperlinks work in Firefox/Netscape. It seems the clickable area is narrowed down to a small area in the middle of the image, around the edges or gone altogether....
7
41717
by: Bob Bedford | last post by:
I've an image in a cell of a table. I've this CSS: ..dbtable{ width: 600px; padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; border-collapse: collapse; border: 1px solid #000000;
4
4819
by: Miguel Dias Moura | last post by:
Hello, I created a datalist in an ASP.Net / VB page. I display the image and price of a few products. When a user clicks an image I want to load the page "detail.aspx?number=id" and send the...
3
4112
by: Fuzzyman | last post by:
Hello all, I'm using a website creation tool (called `rest2web <http://www.voidspace.org.uk/python/rest2web/>`_) that lets me store my content in a text based format ( `ReStructuredText...
7
27471
by: fredo | last post by:
I've studied Eric Meyer's pure css popups, version two: http://meyerweb.com/eric/css/edge/popups/demo2.html which pops up an image when I roll over a text link. Now I want to pop up a large...
27
3830
by: GloStix | last post by:
WARNING VIDEO TAKES A WHILE TO LOAD http://screencast.com/t/BWQ6DNtsM I really don't know how to fix this other than putting another div. But I dont' exactly want to do that for every page....
0
7231
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,...
0
7133
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
7336
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
7504
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...
0
5643
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,...
1
5059
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...
0
3214
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1568
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 ...
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.