简体   繁体   English

如何摆脱边框和图像用作Firefox中的链接?

[英]How to get rid of border around and image used as a link in Firefox?

Weird question I think its more of I am not sure what it is called. 奇怪的问题我认为更多的是我不确定它叫什么。 But I have an img wrapped in an link 但我有一个链接的img

example

...<li>
  <a href="#link">
    <img ...>
  </a>
 </li> .....

Now I have the css border rules all to 0. So their is no Blue border. 现在我将css边界规则全部设为0.所以它们没有蓝色边框。 But in Firefox their seems to be a pink mini dashed border only when I click on the image? 但是在Firefox中,只有当我点击图像时它们似乎是一个粉红色的迷你虚线边框? In other browsers there is no border at any time. 在其他浏览器中,任何时候都没有边框。 Im not sure if its from the browser itself or something I am missing. 我不确定它是来自浏览器本身还是我遗漏的东西。 In my css I have border set to 0 on the a,:hover,:visited I even put text-decoration to none thinking that might help. 在我的CSS中,我将边框设置为0,a:悬停,:访问我甚至将文本修饰设置为无人认为可能会有所帮助。 But to know avail. 但要知道有用。 I tried searching online for help but all I get is info on removing the border caused from placing the image in the link. 我尝试在线搜索帮助,但我得到的是删除因放置链接中的图像而导致的边框的信息。 So any help or a point in the right direction would be great. 所以任何帮助或正确方向上的一点都会很棒。 ! edit// I added a picture to better explain what I am talking about. 编辑//我添加了一张图片,以便更好地解释我在说什么。 替代文字

Links ( <a> 's) by default have a dotted outline around them when they become “active” or “focused”. 链接( <a>的)默认情况下,当它们变为“活动”或“聚焦”时,它们周围会有一个虚线轮廓。 In Firefox 3, the color is determined by the color of the text 在Firefox 3中,颜色由文本的颜色决定

To remove it, simply use: 要删除它,只需使用:

a {
    outline: none;
}

Or you can do what I do, and remove it from all elements (I use my own focus/active rules) and do 或者你可以做我做的事情,并从所有元素中删除它(我使用我自己的焦点/主动规则)并做

* {
    outline: none;
}

This will remove it from all elements. 这将从所有元素中删除它。

#link img a
{
border:0;
outline:none;
}

Install Firebug and see what's going on. 安装Firebug,看看发生了什么。 I think what's going on is img tag probably has a default border. 我认为发生的事情是img tag可能有一个默认的边框。

To remove it maybe you can try putting your a and img tags inside of a div with an id and using following CSS: 要删除它,也许你可以尝试将你的a和img标签放在带有id的div中并使用以下CSS:

Your HTML: 你的HTML:


<div id="test"> <a...> <img .../> </a> </div>
And use the following CSS: 并使用以下CSS:

 #test img { border-style: none; } 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM