html,将链接显示为普通文本
我想知道你是否可以显示一个链接作为普通文本html,将链接显示为普通文本,html,Html,我想知道你是否可以显示一个链接作为普通文本 <a id="" href="" target="_parent"><img src="" width="121" height="20" alt=""> <div style="position:absolute;left:163px;top:1px;font-size: 12px; display: block"> <font color="white">Log in</font><
<a id="" href="" target="_parent"><img src="" width="121" height="20" alt="">
<div style="position:absolute;left:163px;top:1px;font-size: 12px; display: block">
<font color="white">Log in</font></a>
我试图将一个同样是按钮的图像与文本“登录”重叠,它的工作原理与上面的代码相同,但我想知道是否可以将显示为蓝色并带下划线的“登录”更改为普通文本。在css中:
<a id="" href="" target="_parent"><img src="" width="121" height="20" alt="">
<div style="position:absolute;left:163px;top:1px;font-size: 12px; display: block">
<font color="white">Log in</font></a>
a {
color: inherit;
text-decoration: inherit;
}
这些值也可以固定在锚定标记的style
属性中
应该会使锚定标记看起来与父项的文本颜色和装饰相同。如果不希望链接加下划线, 设置“文本装饰:无”简短回答:是 详细回答: 是的,这里有一个链接,但您可能不想对用户隐藏链接
stslavik在“文本装饰:继承”中提出了一个很好的观点。还有一个。在我的浏览器上,“blam”和“stslavic”都显示为strike through,但我会选择“inherit”和“none”;对我来说似乎更好。当然-只需调整页面上“a”元素的CSS。在html文件中使用此代码
<style>
a {
text-decoration: none;
color: #000; /* or whatever colour your text is */
}
</style>
a{
文字装饰:无;
颜色:#000;/*或文本的任何颜色*/
}
如果查看级联样式表(CSS),可以更改链接的颜色和文本样式
在您的示例中,您可以使用
<a id="" href="" target="_parent" style="color: white; text-decoration: none;"><img src="" width="121" height="20" alt="">
<div style="position:absolute; sleft:163px;top:1px;font-size: 12px; display: block">
<font color="white">Log in</font>
</div>
</a>
那么您的html将是
<a class="imgLink" id="" href="" target="_parent">
<img src="" width="121" height="20" alt="">
<div class="imgLink">
Log In
</div>
</a>
它不仅使您的HTML“干燥”,而且只需更改css文件,您就可以更好地控制HTML的样式。只需一个简单的剪贴画,显示一些大小/颜色的可能性,当文本的其余部分稍好时,使您的链接符合主题
(请注意,不要对此做广告,也不要垃圾邮件。单击“仇恨AI”以访问我的项目)
您可以这样做=>
一个讨厌你但仍然帮助你的私人助理。
你正在使用
,这在很久以前就被弃用了,你缺少了一个
。太棒了,还要禁用指针悬停效果---指针事件:无;
<a class="imgLink" id="" href="" target="_parent">
<img src="" width="121" height="20" alt="">
<div class="imgLink">
Log In
</div>
</a>