为什么这个文字装饰不起作用? [英] Why isn't this text-decoration working?
本文介绍了为什么这个文字装饰不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<h1 align="center" text-decoration="none"> <a href="http://www.youtube.com/user/imedddegamer" color="black" text-decoration="none"> My main Youtube channel </a> </h1>
我希望链接中的文字是黑色的,没有装饰,但它不起作用。请帮忙吗?
我尝试过的事情:
我'我也试过在CSS中这样做。
a {
text-decoration:none
}
仍然没有。
I want the text in the link to be black and have no decoration but it doesn't work. Some help please?
What I have tried:
I've tried doing this in CSS as well.
a {
text-decoration: none
}
still nothing.
推荐答案
它只是工作。唯一的问题可能是了解它应该如何工作。你从未解释过你对CSS的期望是什么。请参阅: text-decoration - CSS | MDN [ ^ ]。
为了说明,请考虑以下演示:
It just does work. The only problem is probably the understanding of how it should work. You never explained what exactly did you expect from this CSS. Please see: text-decoration — CSS | MDN[^].
For illustration, consider this demo:
<html>
<head>
<title>Text decoration demo</title>
<style type="text/css">
a { text-decoration: none; }
</style>
</head>
<body>
<a href="http:www.w3.org">W3</a>
</body>
</html>
渲染它,你会发现锚文本没有装饰 - 它没有加下划线。注释掉CSS,你会看到带下划线的锚文本,因为它应该是默认的。在h1上,none装饰是默认的(通常),因此相同的CSS属性不应该有任何效果。
学习HTML和CSS, W3Schools在线网络教程 [ ^ ]
链接页面tuto
HTML链接 [ ^ ]
to learn HTML and CSS, W3Schools Online Web Tutorials[^]
Link page tuto
HTML Links[^]
这篇关于为什么这个文字装饰不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文