Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 为什么在使用display inline和anchor标记后,右侧会有一个小标记?_Html_Css_Anchor_Padding - Fatal编程技术网

Html 为什么在使用display inline和anchor标记后,右侧会有一个小标记?

Html 为什么在使用display inline和anchor标记后,右侧会有一个小标记?,html,css,anchor,padding,Html,Css,Anchor,Padding,我不知道你是否注意到了,但是我的锚标记在右边有一个小标记,这很可能是由css和html混合造成的。在这里: 现在,如果您自己尝试代码,您将在右侧有一小行,它是由什么引起的,我如何消除它?将此css规则添加到锚定标记: text-decoration: none; 这将删除链接末尾的下划线行。复制以下代码: 第一条路 CSS a:-webkit-any-link { text-decoration:none; cursor: auto; } a { colo

我不知道你是否注意到了,但是我的锚标记在右边有一个小标记,这很可能是由css和html混合造成的。在这里:


现在,如果您自己尝试代码,您将在右侧有一小行,它是由什么引起的,我如何消除它?

将此css规则添加到锚定标记:

text-decoration: none;
这将删除链接末尾的下划线行。

复制以下代码: 第一条路 CSS

 a:-webkit-any-link
 {    
    text-decoration:none;
    cursor: auto;
}
a {
   color: #C3C3C3;
   letter-spacing: 1px;
   text-decoration:none;
   }
第二条路 CSS

 a:-webkit-any-link
 {    
    text-decoration:none;
    cursor: auto;
}
a {
   color: #C3C3C3;
   letter-spacing: 1px;
   text-decoration:none;
   }

这一小行是默认下划线定位样式的一部分。因此,只需为标签添加
文本装饰:none

实际上,您不应该在
ul
中使用
a
标签。它不符合W3C标准。 正确的方法是:

<ul>
    <li><a href="#"><strong>Home Page</strong></a></li>
    <li><a href="#"><strong>My Profile</strong></a></li>
    <li><a href="#"><strong>Categories</strong></a></li>
    <li><a href="#"><strong>Contact</strong></a></li>
</ul>
您可以在以下位置检查标记的有效性:


这些标记是空格的下划线。使用空格作为分隔符是不好的做法。使用样式作为边距和填充是更好的方法。

这是由于锚定标记的
文本装饰造成的。如果您不想使用任何额外的
css
,只需删除结束标记
li
a
之间的空间,如。