显示一个链接为普通文本

显示一个链接为普通文本

本文介绍了html,显示一个链接为普通文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 < a id =href = target =_ parent>< img src =width =121height =20alt => 
< div style =position:absolute; left:163px; top:1px; font-size:12px; display:block>
< font color =white>登入< / font>< / a>

我试图重叠同样是一个按钮的图像和文本Log In ,它与上面的代码一样工作,但我想知道是否可以更改显示为蓝色并加下划线显示为普通文本的登录。

解决方案

如果您查看级联样式表(CSS),则可以更改链接的颜色和文本样式。



在你的例子中,你可以使用

 < a id =href =target =_ parentstyle = color:white; text-decoration:none;>< img src =width =121height =20alt => 
< div style =position:absolute; sleft:163px; top:1px; font-size:12px; display:block>
< font color =white>登录< / font>
< / div>
< / a>

但是我会学习如何使用外部样式表并通过<$ c $将它们链接到您的HTML在您的html的< head> 中使用< link> 标签。然后,您可以通过标记名称,ID或CSS类来设置单个标记。所以更新的例子是:

 < link rel =stylesheethref =link-to-your-css-文件/> 

在您的css文件中有

  a.imgLink {
颜色:白色;文字修饰:无;
}
div.imgLink {
position:absolute; left:163px; top:1px; font-size:12px;显示:块;
}

然后你的html会是

 < a class =imgLinkid =href =target =_ parent> 
< img src =width =121height =20alt =>
< div class =imgLink>
登入
< / div>
< / a>

它不仅会让HTML变得干燥,而且会让您更好地控制您的样式html只改变css文件。


i was wondering if you can display a link as normal text.

<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>

I'm trying to overlap a image which is also a button, with the text "Log In", it works as it is with the code above, but i was wondering if i can change the "log in" which displays as blue and underlined to appear as normal text.

解决方案

If you have a look at Cascading Style Sheets (CSS) you can change the colour and the text style of the link.

In your example, you could use

<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>

However I would learn how to use external stylesheets and link them to your HTML through the <link> tag in the <head> of your html. You can then style up individual tags through the tag name, an id or a css class. So an updated example would be:

<link rel="stylesheet" href="link-to-your-css-file" />

in your css file have

a.imgLink{
    color: white; text-decoration: none;
}
div.imgLink{
    position: absolute; left: 163px; top: 1px; font-size: 12px; display: block;
}

Then your html would be

<a class="imgLink" id="" href="" target="_parent">
    <img src="" width="121" height="20" alt="">
    <div class="imgLink">
         Log In
    </div>
</a>

Not only does it make your HTML "dry" but it gives you greater control over the styles of your html by only changing the css file.

这篇关于html,显示一个链接为普通文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 15:53