Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/75.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 标记类不工作_Html_Css_Hyperlink_Tags - Fatal编程技术网

Html 标记类不工作

Html 标记类不工作,html,css,hyperlink,tags,Html,Css,Hyperlink,Tags,我有一个标签,我正试图添加一个类。这可能真的很简单,但我以前从未这样做过 <a class="button" href="landscaping.html">Find out more about our landscape design services</a> 好像什么都没用,我只是买了标准的蓝色。有人能帮忙吗?应该没有空间!请更改: a .button{ 致: 查看这里的fiddle:您在CSS中所说的是“我希望所有具有class按钮的子类,所有a标记都使用下一

我有一个标签,我正试图添加一个类。这可能真的很简单,但我以前从未这样做过

<a class="button" href="landscaping.html">Find out more about our landscape design services</a>

好像什么都没用,我只是买了标准的蓝色。有人能帮忙吗?

应该没有空间!请更改:

a .button{
致:


查看这里的fiddle:

您在CSS中所说的是“我希望所有具有class
按钮的子类
,所有
a
标记都使用下一个CSS规则”

您需要说的是“我希望使用class
按钮标记
a
,以使用下一个CSS规则”

这是通过编写下一个CSS来实现的:

a.button{
  color:#7cc242;
  font-family: 'PTSansNarrowBold';
  font-size:18px;
  margin-top: 7px;
  margin-bottom: 0px;
  text-align:right;
  text-decoration:none;
  display: inline-block;
  zoom:1;
  *display:inline;
  padding-right:30px;
  background:url(images/more-btn.png) no-repeat top right;
}
请注意,
a
按钮之间没有空格

标记/类/ID之间的空格表示“元素的子元素”


祝你好运:)

像这样删除
a.button
的空格,或者简单地使用
。button

非常感谢!哦,我就知道这是一个愚蠢的问题。谢谢你帮我看到了显而易见的事实!
a.button{
a.button{
  color:#7cc242;
  font-family: 'PTSansNarrowBold';
  font-size:18px;
  margin-top: 7px;
  margin-bottom: 0px;
  text-align:right;
  text-decoration:none;
  display: inline-block;
  zoom:1;
  *display:inline;
  padding-right:30px;
  background:url(images/more-btn.png) no-repeat top right;
}