简体   繁体   English

添加具有不同颜色的跨度实际上并没有改变颜色

[英]Adding a span with a different color isn't actually changing the color

I made a small index page and made the logo using text and styling, and added a span to change the color of one of the words but it's not actually changing.我制作了一个小的索引页面并使用文本和样式制作了徽标,并添加了一个跨度来更改其中一个单词的颜色,但实际上并没有改变。 I'm not sure why.我不确定为什么。 I made a span with a class of .highlight and gave the special color to that .highlight and even tried adding !important but it still isn't working.我用 .highlight 的.highlight做了一个跨度,并为.highlight赋予了特殊的color ,甚至尝试添加!important但它仍然无法正常工作。

This is the page - https://youssefwaelnasr.github.io/hat-manufacturers/ -- the word "Hat" is in a span with the class of .highlight that has a different color, but it's not working here. This is the page - https://youssefwaelnasr.github.io/hat-manufacturers/ -- the word "Hat" is in a span with the class of .highlight that has a different color, but it's not working here.

Here's the GitHub repo with code in it (index.html and css/style.css) - https://github.com/youssefwaelnasr/hat-manufacturers这是 GitHub 存储库,其中包含代码(index.html 和 css/style.css) -https://github.com/youssefwaelnas

Thanks in advance.提前致谢。

Your html is invalid您的 html 无效

 <span class="highlight"></span>Hat</span> Manufacturers

Should be应该

 <span class="highlight">Hat</span> Manufacturers

In your code at line 17 on your GitHub file (index.html), the <span> tag is not correct.在 GitHub 文件 (index.html) 第 17 行的代码中, <span>标记不正确。

Replace the line 17 :替换第17 行

<h1><i class="fab fa-redhat"></i> <span class="highlight"> Hat</span> Manufacturers</h1>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM