设置a标签样式,不知怎么设置啊,把那个链接放到href里面,这个不会啊

设置a标签样式,不知怎么设置啊,把那个链接放到href里面,这个不会啊,第1张

文字链接

样式1.<A href=链接地址 target=_blank>要链接的文字</A>

样式2.<A href="链接地址" target="_blank"><FONT COLOR="#FF0000">要链接的文字</FONT></A><FONT COLOR="#FF0000">

上面两种样式自己选一种就可以了.图片链接的第2种样式可以控制图片的大小,文字链接的第2种样式可以控制字体的颜色.自己选吧!

不可以

css设置的是页面的样式,也就是说可以设置a标签的种种样式。但是a标签中的值等内容并不是在样式中设置的。

如:

<style>

.hrefcss(float:leftwidth:100pxheight:30pxbackground:#000)

</style>

<a href="www.shopjsp.com" class="hrefclass" />

这样我们设置了a标签的宽高、背景颜色以及对其方式,而标签中的内容是填写的时候决定的,因此无法再css中设置href的值。

使用css样式即可,方法如下:

1、在网页头部<head></head>直接放置以下代码:

<style type="text/css">

a.topcs:link {

font-size: 12px

color: #000000

text-decoration: none

}

a.topcs:visited {

font-size: 12px

color: #000000

text-decoration: none

}

a.topcs:hover {

font-size: 12px

color: #FF0000

text-decoration: none

}

a.news:link {

font-size: 12px

color: #000000

text-decoration: none

}

a.news:visited {

font-size: 12px

color: #000000

text-decoration: none

}

a.news:hover {

font-size: 12px

color: #FF0000

text-decoration: none

}</style>

2、在网页主体建立超链接,分别套用topcs和news样式:

<a href="1.html" class="news">1</a><a href="2.html" class="topcs">1</a>


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/tougao/11301558.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-15
下一篇 2023-05-15

发表评论

登录后才能评论

评论列表(0条)

保存